!% $MAX_ARRAYS=1500 !% $MAX_CLASSES=200 !% $MAX_VERBS=255 !% $MAX_LABELS=10000 !% $MAX_ZCODE_SIZE=50000 !% $MAX_STATIC_DATA=300000 !% $MAX_PROP_TABLE_SIZE=200000 !% $MAX_INDIV_PROP_TABLE_SIZE=20000 !% $MAX_STACK_SIZE=65536 !% $MAX_SYMBOLS=20000 !% $MAX_EXPRESSION_NODES=256 !% $MAX_OBJ_PROP_COUNT=128 Constant Grammar__Version 2; ! This file was compiled by Inform 7: the build number and version of the ! I6 template layer used are as follows. Constant NI_BUILD_COUNT "5Z71"; Constant LibSerial = "080126"; Constant LibRelease = "6/12N"; Constant LIBRARY_VERSION = 612; Array UUID_ARRAY string "UUID://AD043E3E-23E1-11DF-AC44-0026182F8D31//"; Constant Story SC_2; Constant Headline "An Interactive Fiction"; Constant Story_Author SC_3; Serial "100429"; Default Story 0; Default Headline 0; [ ShowExtensionVersions; print "Standard Rules version 2/090402 by Graham Nelson^"; print "Simple Chat version 2 by Mark Tilford^"; print "Dice-lock version 1/080522 by S John Ross^"; ]; [ ShowFullExtensionVersions; print "Standard Rules version 2/090402 by Graham Nelson^"; print "Simple Chat version 2 by Mark Tilford^"; print "Basic Screen Effects version 6 by Emily Short^"; print "Plurality version 6 by Emily Short^"; print "Dice-lock version 1/080522 by S John Ross^"; ]; ! Use option: Constant DynamicMemoryAllocation = 8192; ! Use option: Constant IT_MemoryBufferSize = 1024+3; ! Use option: Constant MATCH_LIST_WORDS = 100; ! Use option: Constant I7_LOOKMODE = 2; ! Use option: Constant NO_SCORING; ! Use option: Constant AllowingExit 0; #Ifndef WORDSIZE; ! compiling with Z-code only compiler Constant TARGET_ZCODE; Constant WORDSIZE 2; #Endif; #Iftrue (WORDSIZE == 2); Constant NULL = $ffff; Constant WORD_HIGHBIT = $8000; Constant WORD_NEXTTOHIGHBIT = $4000; Constant IMPROBABLE_VALUE = $7fe3; Constant MAX_POSITIVE_NUMBER 32767; Constant MIN_NEGATIVE_NUMBER -32768; Constant REPARSE_CODE = 10000; #Endif; #Iftrue (WORDSIZE == 4); Constant NULL = $ffffffff; Constant WORD_HIGHBIT = $80000000; Constant WORD_NEXTTOHIGHBIT = $40000000; Constant IMPROBABLE_VALUE = $deadce11; Constant MAX_POSITIVE_NUMBER 2147483647; Constant MIN_NEGATIVE_NUMBER -2147483648; Constant REPARSE_CODE = $40000000; #Endif; #Ifdef TARGET_ZCODE; Global max_z_object; Constant INDIV_PROP_START 64; ! Offsets into Z-machine header: Constant HDR_ZCODEVERSION = $00; ! byte Constant HDR_TERPFLAGS = $01; ! byte Constant HDR_GAMERELEASE = $02; ! word Constant HDR_HIGHMEMORY = $04; ! word Constant HDR_INITIALPC = $06; ! word Constant HDR_DICTIONARY = $08; ! word Constant HDR_OBJECTS = $0A; ! word Constant HDR_GLOBALS = $0C; ! word Constant HDR_STATICMEMORY = $0E; ! word Constant HDR_GAMEFLAGS = $10; ! word Constant HDR_GAMESERIAL = $12; ! six ASCII characters Constant HDR_ABBREVIATIONS = $18; ! word Constant HDR_FILELENGTH = $1A; ! word Constant HDR_CHECKSUM = $1C; ! word Constant HDR_TERPNUMBER = $1E; ! byte Constant HDR_TERPVERSION = $1F; ! byte Constant HDR_SCREENHLINES = $20; ! byte Constant HDR_SCREENWCHARS = $21; ! byte Constant HDR_SCREENWUNITS = $22; ! word Constant HDR_SCREENHUNITS = $24; ! word Constant HDR_FONTWUNITS = $26; ! byte Constant HDR_FONTHUNITS = $27; ! byte Constant HDR_ROUTINEOFFSET = $28; ! word Constant HDR_STRINGOFFSET = $2A; ! word Constant HDR_BGCOLOUR = $2C; ! byte Constant HDR_FGCOLOUR = $2D; ! byte Constant HDR_TERMCHARS = $2E; ! word Constant HDR_PIXELSTO3 = $30; ! word Constant HDR_TERPSTANDARD = $32; ! two bytes Constant HDR_ALPHABET = $34; ! word Constant HDR_EXTENSION = $36; ! word Constant HDR_UNUSED = $38; ! two words Constant HDR_INFORMVERSION = $3C; ! four ASCII characters #Endif; #IFDEF TARGET_GLULX; Global unicode_gestalt_ok; ! Set if interpreter supports Unicode ! Offsets into Glulx header and start of ROM: Constant HDR_MAGICNUMBER = $00; ! long word Constant HDR_GLULXVERSION = $04; ! long word Constant HDR_RAMSTART = $08; ! long word Constant HDR_EXTSTART = $0C; ! long word Constant HDR_ENDMEM = $10; ! long word Constant HDR_STACKSIZE = $14; ! long word Constant HDR_STARTFUNC = $18; ! long word Constant HDR_DECODINGTBL = $1C; ! long word Constant HDR_CHECKSUM = $20; ! long word Constant ROM_INFO = $24; ! four ASCII characters Constant ROM_MEMORYLAYOUT = $28; ! long word Constant ROM_INFORMVERSION = $2C; ! four ASCII characters Constant ROM_COMPVERSION = $30; ! four ASCII characters Constant ROM_GAMERELEASE = $34; ! short word Constant ROM_GAMESERIAL = $36; ! six ASCII characters #Endif; Array PowersOfTwo_TB --> $$100000000000 $$010000000000 $$001000000000 $$000100000000 $$000010000000 $$000001000000 $$000000100000 $$000000010000 $$000000001000 $$000000000100 $$000000000010 $$000000000001; Array IncreasingPowersOfTwo_TB --> $$0000000000000001 $$0000000000000010 $$0000000000000100 $$0000000000001000 $$0000000000010000 $$0000000000100000 $$0000000001000000 $$0000000010000000 $$0000000100000000 $$0000001000000000 $$0000010000000000 $$0000100000000000 $$0001000000000000 $$0010000000000000 $$0100000000000000 $$1000000000000000; Constant NORMAL_VMSTY = 0; Constant HEADER_VMSTY = 3; Constant SUBHEADER_VMSTY = 4; Constant ALERT_VMSTY = 5; Constant NOTE_VMSTY = 6; Constant BLOCKQUOTE_VMSTY = 7; Constant INPUT_VMSTY = 8; Constant CLR_DEFAULT = 1; Constant CLR_BLACK = 2; Constant CLR_RED = 3; Constant CLR_GREEN = 4; Constant CLR_YELLOW = 5; Constant CLR_BLUE = 6; Constant CLR_MAGENTA = 7; Constant CLR_PURPLE = 7; Constant CLR_CYAN = 8; Constant CLR_AZURE = 8; Constant CLR_WHITE = 9; Constant WIN_ALL = 0; ! Both windows at once Constant WIN_STATUS = 1; Constant WIN_MAIN = 2; Constant PARA_COMPLETED = 1; Constant PARA_PROMPTSKIP = 2; Constant PARA_SUPPRESSPROMPTSKIP = 4; Constant PARA_NORULEBOOKBREAKS = 8; Constant PARA_CONTENTEXPECTED = 16; Constant POSSESS_PK = $100; Constant DEFART_PK = $101; Constant INDEFART_PK = $102; Constant RTP_BACKDROP = 1; Constant RTP_EXITDOOR = 2; Constant RTP_NOEXIT = 3; Constant RTP_CANTCHANGE = 4; Constant RTP_IMPREL = 5; Constant RTP_RULESTACK = 6; Constant RTP_TOOMANYRULEBOOKS = 7; Constant RTP_TOOMANYEVENTS = 8; Constant RTP_BADPROPERTY = 9; Constant RTP_UNPROVIDED = 10; Constant RTP_UNSET = 11; Constant RTP_TOOMANYACTS = 12; Constant RTP_CANTABANDON = 13; Constant RTP_CANTEND = 14; Constant RTP_CANTMOVENOTHING = 15; Constant RTP_CANTREMOVENOTHING = 16; Constant RTP_DIVZERO = 17; Constant RTP_BADVALUEPROPERTY = 18; Constant RTP_NOTBACKDROP = 19; Constant RTP_TABLE_NOCOL = 20; Constant RTP_TABLE_NOCORR = 21; Constant RTP_TABLE_NOROW = 22; Constant RTP_TABLE_NOENTRY = 23; Constant RTP_TABLE_NOTABLE = 24; Constant RTP_TABLE_NOMOREBLANKS = 25; Constant RTP_TABLE_NOROWS = 26; Constant RTP_TABLE_CANTSORT = 27; Constant RTP_NOTINAROOM = 28; Constant RTP_BADTOPIC = 29; Constant RTP_ROUTELESS = 30; Constant RTP_PROPOFNOTHING = 31; Constant RTP_DECIDEONWRONGKIND = 32; Constant RTP_DECIDEONNOTHING = 33; Constant RTP_TABLE_CANTSAVE = 34; Constant RTP_TABLE_WONTFIT = 35; Constant RTP_TABLE_BADFILE = 36; Constant RTP_LOWLEVELERROR = 37; Constant RTP_DONTIGNORETURNSEQUENCE = 38; Constant RTP_SAYINVALIDSNIPPET = 39; Constant RTP_SPLICEINVALIDSNIPPET = 40; Constant RTP_INCLUDEINVALIDSNIPPET = 41; Constant RTP_LISTWRITERMEMORY = 42; Constant RTP_CANTREMOVEPLAYER = 43; Constant RTP_CANTREMOVEDOORS = 44; Constant RTP_CANTCHANGEOFFSTAGE = 45; Constant RTP_MSTACKMEMORY = 46; Constant RTP_TYPECHECK = 47; Constant RTP_FILEIOERROR = 48; Constant RTP_HEAPERROR = 49; Constant RTP_LISTRANGEERROR = 50; Constant RTP_REGEXPSYNTAXERROR = 51; Constant RTP_NOGLULXUNICODE = 52; Constant RTP_BACKDROPONLY = 53; Constant RTP_NOTTHING = 54; Constant RTP_SCENEHASNTSTARTED = 55; Constant RTP_SCENEHASNTENDED = 56; Constant RTP_NEGATIVEROOT = 57; Constant Relation_Implicit = -1; Constant Relation_OtoO = 1; Constant Relation_OtoV = 2; Constant Relation_VtoO = 3; Constant Relation_VtoV = 4; Constant Relation_Sym_OtoO = 5; Constant Relation_Sym_VtoV = 6; Constant Relation_Equiv = 7; Constant Relation_ByRoutine = 8; Constant PRINTING_THE_NAME_ACT = 0; Constant PRINTING_THE_PLURAL_NAME_ACT = 1; Constant PRINTING_A_NUMBER_OF_ACT = 2; Constant PRINTING_ROOM_DESC_DETAILS_ACT = 3; Constant LISTING_CONTENTS_ACT = 4; Constant GROUPING_TOGETHER_ACT = 5; Constant WRITING_A_PARAGRAPH_ABOUT_ACT = 6; Constant LISTING_NONDESCRIPT_ITEMS_ACT = 7; Constant PRINTING_NAME_OF_DARK_ROOM_ACT = 8; Constant PRINTING_DESC_OF_DARK_ROOM_ACT = 9; Constant PRINTING_NEWS_OF_DARKNESS_ACT = 10; Constant PRINTING_NEWS_OF_LIGHT_ACT = 11; Constant REFUSAL_TO_ACT_IN_DARK_ACT = 12; Constant CONSTRUCTING_STATUS_LINE_ACT = 13; Constant PRINTING_BANNER_TEXT_ACT = 14; Constant READING_A_COMMAND_ACT = 15; Constant DECIDING_SCOPE_ACT = 16; Constant DECIDING_CONCEALED_POSSESS_ACT = 17; Constant DECIDING_WHETHER_ALL_INC_ACT = 18; Constant CLARIFYING_PARSERS_CHOICE_ACT = 19; Constant ASKING_WHICH_DO_YOU_MEAN_ACT = 20; Constant PRINTING_A_PARSER_ERROR_ACT = 21; Constant SUPPLYING_A_MISSING_NOUN_ACT = 22; Constant SUPPLYING_A_MISSING_SECOND_ACT = 23; Constant IMPLICITLY_TAKING_ACT = 24; Constant STARTING_VIRTUAL_MACHINE_ACT = 25; Constant AMUSING_A_VICTORIOUS_PLAYER_ACT = 26; Constant PRINTING_PLAYERS_OBITUARY_ACT = 27; Constant DEALING_WITH_FINAL_QUESTION_ACT = 28; Constant PRINTING_LOCALE_DESCRIPTION_ACT = 29; Constant CHOOSING_NOTABLE_LOCALE_OBJ_ACT = 30; Constant PRINTING_LOCALE_PARAGRAPH_ACT = 31; Constant PROCEDURAL_RB = 0; Constant STARTUP_RB = 1; Constant TURN_SEQUENCE_RB = 2; Constant SHUTDOWN_RB = 3; Constant WHEN_PLAY_BEGINS_RB = 5; Constant WHEN_PLAY_ENDS_RB = 6; Constant ACTION_PROCESSING_RB = 8; Constant SETTING_ACTION_VARIABLES_RB = 9; Constant SPECIFIC_ACTION_PROCESSING_RB = 10; Constant ACCESSIBILITY_RB = 12; Constant REACHING_INSIDE_RB = 13; Constant REACHING_OUTSIDE_RB = 14; Constant VISIBLE_RB = 15; Constant PERSUADE_RB = 16; Constant UNSUCCESSFUL_ATTEMPT_RB = 17; Constant AFTER_RB = 22; Constant REPORT_RB = 23; Constant UNKNOWN_TY = 1; Constant MATCHING_FMY = 5; Constant NEW_LOCAL_VARIABLE_NAME_SPC = 6; Constant VALUE_FMY = 10; Constant CONSTANT_SPC = 11; Constant PHRASE_TO_DECIDE_VALUE_SPC = 12; Constant STORAGE_FMY = 20; Constant LOCAL_VARIABLE_SPC = 21; Constant NONLOCAL_VARIABLE_SPC = 22; Constant PROPERTY_VALUE_SPC = 23; Constant TABLE_ENTRY_SPC = 24; Constant LIST_ENTRY_SPC = 25; Constant CONDITION_FMY = 30; Constant LOGICAL_AND_SPC = 31; Constant LOGICAL_OR_SPC = 32; Constant TEST_PROPOSITION_SPC = 33; Constant TEST_PHRASE_OPTION_SPC = 34; Constant TEST_ACTION_SPC = 35; Constant TEST_PAST_ACTION_SPC = 36; Constant NOW_PROPOSITION_SPC = 37; Constant PHRASE_TO_DECIDE_IF_SPC = 38; Constant DESCRIPTION_SPC = 39; Constant COMMAND_FMY = 40; Constant TO_PHRASE_SPC = 41; Constant END_BLOCK_SPC = 42; Constant OTHERWISE_SPC = 43; Constant CASE_SPC = 44; Constant RULEBOOK_OUTCOME_PHRASE_SPC = 45; Constant TRY_ACTION_SPC = 46; Constant ANY_VALUE_TY = 50; Constant ASSIGNABLE_VALUE_TY = 51; Constant KIND_OF_WORD_VALUE_TY = 52; Constant KIND_OF_POINTER_VALUE_TY = 53; Constant DESCRIPTION_OF_ACTION_TY = 54; Constant VALUE_DESCRIPTION_TY = 55; Constant NO_ENTRIES_TY = 56; Constant NUMBER_TY = 57; Constant TIME_TY = 58; Constant TEXT_TY = 59; Constant TEXT_ROUTINE_TY = 60; Constant QUOT_TY = 61; Constant SNIPPET_TY = 62; Constant UNICODECHAR_TY = 63; Constant OBJECT_TY = 64; Constant OBJECT_DESCRIPTION_TY = 65; Constant USEOPTION_TY = 66; Constant PROPERTY_TY = 67; Constant RULE_TY = 68; Constant RULEBOOK_TY = 69; Constant RULEBOOK_OUTCOME_TY = 70; Constant ACTION_NAME_TY = 71; Constant ACTIVITY_TY = 72; Constant SCENE_TY = 73; Constant TABLE_TY = 74; Constant TABLE_COLUMN_TY = 75; Constant EQUATION_TY = 76; Constant RELATION_TY = 77; Constant UNDERSTANDING_TY = 78; Constant FIGURENAME_TY = 79; Constant SOUNDNAME_TY = 80; Constant EXTERNALFILE_TY = 81; Constant TRUTH_STATE_TY = 82; Constant INDEXED_TEXT_TY = 83; Constant STORED_ACTION_TY = 84; Constant LIST_OF_TY = 85; Constant INTERMEDIATE_TY = 86; Constant ANY_POINTER_VALUE_TY = 87; Constant ANY_WORD_VALUE_TY = 88; Constant CLASSIFIED_TY = 89; Constant TEMPLATE_VAR1_TY = 90; Constant TEMPLATE_VAR2_TY = 91; Constant TEMPLATE_VAR3_TY = 92; Constant TEMPLATE_VAR4_TY = 93; Constant RULE_OUTCOME_TY = 94; Constant STUCK_PE = 1; Constant UPTO_PE = 2; Constant NUMBER_PE = 3; Constant ANIMA_PE = 4; Constant CANTSEE_PE = 5; Constant TOOLIT_PE = 6; Constant NOTHELD_PE = 7; Constant MULTI_PE = 8; Constant MMULTI_PE = 9; Constant VAGUE_PE = 10; Constant EXCEPT_PE = 11; Constant VERB_PE = 12; Constant SCENERY_PE = 13; Constant ITGONE_PE = 14; Constant JUNKAFTER_PE = 15; Constant TOOFEW_PE = 16; Constant NOTHING_PE = 17; Constant ASKSCOPE_PE = 18; Constant NOTINCONTEXT_PE = 19; Constant BLANKLINE_PE = 20; ! Not formally a parser error, but used by I7 as if Constant PARSING_REASON = 0; Constant TALKING_REASON = 1; Constant EACH_TURN_REASON = 2; Constant LOOPOVERSCOPE_REASON = 5; Constant TESTSCOPE_REASON = 6; Constant ILLEGAL_TT = 0; ! Types of grammar token: illegal Constant ELEMENTARY_TT = 1; ! (one of those below) Constant PREPOSITION_TT = 2; ! e.g. 'into' Constant ROUTINE_FILTER_TT = 3; ! e.g. noun=CagedCreature Constant ATTR_FILTER_TT = 4; ! e.g. edible Constant SCOPE_TT = 5; ! e.g. scope=Spells Constant GPR_TT = 6; ! a general parsing routine Constant NOUN_TOKEN = 0; ! The elementary grammar tokens, and Constant HELD_TOKEN = 1; ! the numbers compiled by I6 to Constant MULTI_TOKEN = 2; ! encode them Constant MULTIHELD_TOKEN = 3; Constant MULTIEXCEPT_TOKEN = 4; Constant MULTIINSIDE_TOKEN = 5; Constant CREATURE_TOKEN = 6; Constant SPECIAL_TOKEN = 7; Constant NUMBER_TOKEN = 8; Constant TOPIC_TOKEN = 9; Constant ENDIT_TOKEN = 15; ! Value used to mean "end of grammar line" Constant GPR_FAIL = -1; ! Return values from General Parsing Constant GPR_PREPOSITION = 0; ! Routines Constant GPR_NUMBER = 1; Constant GPR_MULTIPLE = 2; Constant GPR_REPARSE = REPARSE_CODE; Constant GPR_NOUN = -256; ! Reparse, but as |NOUN_TOKEN| this time Constant GPR_HELD = GPR_NOUN + 1; ! And so on Constant GPR_MULTI = GPR_NOUN + 2; Constant GPR_MULTIHELD = GPR_NOUN + 3; Constant GPR_MULTIEXCEPT = GPR_NOUN + 4; Constant GPR_MULTIINSIDE = GPR_NOUN + 5; Constant GPR_CREATURE = GPR_NOUN + 6; Constant NEWLINE_BIT = $$0000000000000001; ! New-line after each entry Constant INDENT_BIT = $$0000000000000010; ! Indent each entry by depth Constant FULLINV_BIT = $$0000000000000100; ! Full inventory information after entry Constant ENGLISH_BIT = $$0000000000001000; ! English sentence style, with commas and and Constant RECURSE_BIT = $$0000000000010000; ! Recurse downwards with usual rules Constant ALWAYS_BIT = $$0000000000100000; ! Always recurse downwards Constant TERSE_BIT = $$0000000001000000; ! More terse English style Constant PARTINV_BIT = $$0000000010000000; ! Only brief inventory information after entry Constant DEFART_BIT = $$0000000100000000; ! Use the definite article in list Constant WORKFLAG_BIT = $$0000001000000000; ! At top level (only), only list objects ! which have the "workflag" attribute Constant ISARE_BIT = $$0000010000000000; ! Print " is" or " are" before list Constant CONCEAL_BIT = $$0000100000000000; ! Omit objects with "concealed" or "scenery": ! if WORKFLAG_BIT also set, then does not ! apply at top level, but does lower down Constant NOARTICLE_BIT = $$0001000000000000; ! Print no articles, definite or not Constant EXTRAINDENT_BIT = $$0010000000000000; ! New in I7: extra indentation of 1 level Constant CFIRSTART_BIT = $$0100000000000000; ! Capitalise first article in list Constant QUARTER_HOUR = 15; Constant HALF_HOUR = 30; Constant ONE_HOUR = 60; Constant TWELVE_HOURS = 720; Constant TWENTY_FOUR_HOURS = 1440; Constant EMPTY_TEXT_VALUE ""; Array TheEmptyTable --> 0 0; Array EMPTY_RULEBOOK -> $ff $ff $ff $ff; [ Prop_Falsity reason obj; return 0; ]; Default MAX_SCORE 0; Attribute absent; ! Used to mark objects removed from play Attribute animate; ! I6-level marker for I7 kind "person" Attribute clothing; ! = I7 "wearable" Attribute concealed; ! = I7 "undescribed" Attribute container; ! I6-level marker for I7 kind "container" Attribute door; ! I6-level marker for I7 kind "door" Attribute edible; ! = I7 "edible" vs "inedible" Attribute enterable; ! = I7 "enterable" Attribute light; ! = I7 "lighted" vs "dark" Attribute lockable; ! = I7 "lockable" Attribute locked; ! = I7 "locked" Attribute moved; ! = I7 "handled" Attribute on; ! = I7 "switched on" vs "switched off" Attribute open; ! = I7 "open" vs "closed" Attribute openable; ! = I7 "openable" Attribute scenery; ! = I7 "scenery" Attribute static; ! = I7 "fixed in place" vs "portable" Attribute supporter; ! I6-level marker for I7 kind "supporter" Attribute switchable; ! I6-level marker for I7 kind "device" Attribute talkable; ! Not currently used by I7, but retained for possible future use Attribute transparent; ! = I7 "transparent" vs "opaque" Attribute visited; ! = I7 "visited" Attribute worn; ! marks that an object tree edge represents wearing Attribute male; ! not directly used by I7, but available for languages with genders Attribute female; ! = I7 "female" vs "male" Attribute neuter; ! = I7 "neuter" Attribute pluralname; ! = I7 "plural-named" Attribute proper; ! = I7 "proper-named" Attribute remove_proper; ! remember to remove proper again when using ChangePlayer next Attribute initially_carried; ! New in I7 Constant privately_named = initially_carried; ! = I7 "privately-named"; not used at run-time Attribute mentioned; ! New in I7 Attribute pushable; ! New in I7 Attribute mark_as_room; ! Used in I7 to speed up testing "ofclass K1_room" Attribute mark_as_thing; ! Used in I7 to speed up testing "ofclass K2_thing" Attribute workflag; ! = I7 "marked for listing", but basically temporary workspace Attribute workflag2; ! new in I7 and also temporary workspace Constant list_filter_permits = initially_carried; ! another I7 listwriter convenience Property add_to_scope; ! used as in I6 to place component parts in scope Property article "a"; ! used as in I6 to implement articles Property capacity 100; ! = I7 "carrying capacity" Property component_child; ! new in I7: forest structure holding "part of" relation Property component_parent; ! new in I7 Property component_sibling; ! new in I7 Property description; ! = I7 "description" Property door_dir; ! used to implement two-sided doors, but holds direction object, not a property Property door_to; ! used as in I6 to implement two-sided doors Property found_in; ! used as in I6 to implement two-sided doors and backdrops Property initial; ! = I7 "initial description" Property list_together; ! used as in I6 to implement "grouping together" activity Property map_region; ! new in I7 Property parse_name 0; ! used as in I6 to implement "Understand... as..." grammars Property plural; ! used as in I6 to implement plural names for duplicate objects Property regional_found_in; ! new in I7 Property room_index; ! new in I7: storage for route-finding Property short_name 0; ! = I7 "printed name" Property vector; ! new in I7: storage for route-finding Property with_key; ! = I7 "matching key" Property IK_0; ! Instance count of the kind of the current object Property IK_1; ! These are instance counts within kinds K1, K2, ... Property IK_2; ! and it is efficient to declare the common ones with Property Property IK_4; ! since this results in a slightly smaller story file Property IK_5; Property IK_6; Property IK_8; Property IK1_link; ! These are for linked lists used to make searches faster Property IK2_link; ! and again it's memory-efficient to declare the common ones Property IK5_link; ! Property IK6_link; ! Property IK8_link; ! Property articles; ! not used by I7, but an interesting hook in the parser Property grammar; ! not used by I7, but an interesting hook in the parser Property inside_description; ! not used by I7, but an interesting hook in the locale code Property short_name_indef 0; ! not used by I7, but an interesting hook in the listmaker Constant life = NULL; Constant ActionCount = 92; Fake_Action ListMiscellany; Fake_Action Miscellany; Fake_Action PluralFound; Fake_Action TheSame; Constant RUCKSACK_CLASS = K28_player_s_holdall; ! [1] Global location = InformLibrary; ! does not = I7 "location": see below Global sline1; Global sline2; ! [2] Global say__p = 1; Global say__pc = 0; Global say__n; Global ct_0 = 0; Global ct_1 = 0; Global los_rv = false; Global subst__v; ! = I7 "substitution-variable" Global parameter_object; ! = I7 "parameter-object" = I7 "container in question" Array deferred_calling_list --> 16; Global property_to_be_totalled; ! used to implement "total P of..." Global property_loop_sign; ! $+1$ for increasing order, $-1$ for decreasing Global suppress_scope_loops; Global temporary_value; ! can be used anywhere side-effects can't occur Global enable_rte = true; ! reporting of run-time problems is enabled Constant BLOCKV_STACK_SIZE = 224; Global blockv_sp = 0; Array blockv_stack --> BLOCKV_STACK_SIZE; Global IT_RE_Err = 0; Array LocalParking --> 16; ! [3] Global standard_interpreter = 0; Global undo_flag; ! [4] Global deadflag = 0; Global resurrect_please = false; ! [5] Global not_yet_in_play = true; ! set false when first command received Global turns = 1; ! = I7 "turn count" Global the_time = NULL; ! = I7 "time of day" Global time_rate = 1; Constant NUMBER_SCENES_CREATED = 1; Constant SCENE_ARRAY_SIZE = (NUMBER_SCENES_CREATED+2); Array scene_started --> SCENE_ARRAY_SIZE; Array scene_ended --> SCENE_ARRAY_SIZE; Array scene_status --> SCENE_ARRAY_SIZE; Array scene_endings --> SCENE_ARRAY_SIZE; Array scene_latest_ending --> SCENE_ARRAY_SIZE; Array scene_recurs -> 0 0 0; ! [6] Global score; ! = I7 "score" Global last_score; ! = I7 "last notified score" Global notify_mode = 1; ! score notification on or off Global left_hand_status_line = SL_Location; ! = I7 "left hand status line" Global right_hand_status_line = SL_Score_Moves; ! = I7 "right hand status line" ! [7] Global player; ! = I7 "player" Global real_location; ! = I7 "location" Global visibility_ceiling; ! highest object in tree visible to player Global visibility_levels; ! distance in tree to that Global SACK_OBJECT; ! current player's holdall item in use ! [8] Global act_requester; Global actor; ! = I7 "person asked" = I7 "person reaching" Global actors_location; ! like real_location, but for the actor Global actor_location; ! = I7 "actor-location" Global action; Global meta; ! action is out of world Global inp1; Global inp2; Array multiple_object --> MATCH_LIST_WORDS; ! multiple-object list (I6 table array) Global toomany_flag; ! multiple-object list overflowed Global multiflag; ! multiple-object being processed Global multiple_object_item; ! item currently being processed in multiple-object list Global noun; ! = I7 "noun" Global second; ! = I7 "second noun" Global keep_silent; ! true if current action is being tried silently Global etype; ! parser error number if command not recognised Global trace_actions = 0; Global untouchable_object; Global untouchable_silence; Global touch_persona; Global special_word; ! dictionary address of first word in "[text]" token Global consult_from; ! word number of start of "[text]" token Global consult_words; ! number of words in "[text]" token Global parsed_number; ! value from any token not an object Global special_number1; ! first value, if token not an object Global special_number2; ! second value, if token not an object Array parser_results --> 16; ! for parser to write its results in Global parser_trace = 0; ! normally 0, but 1 to 5 traces parser workings Global pronoun_word; ! records which pronoun ("it", "them", ...) caused an error Global pronoun_obj; ! and what object it was thought to refer to Global players_command; ! = I7 "player's command" Global matched_text; ! = I7 "matched text" Global reason_the_action_failed; ! = I7 "reason the action failed" Global understand_as_mistake_number; ! which form of "Understand... as a mistake" Global particular_possession; ! = I7 "particular possession" ! [9] Global parser_action; ! written by the parser for the benefit of GPRs Global parser_one; Global parser_two; Global parameters; ! number of I7 tokens parsed on the current line Global action_to_be; ! (if the current line were accepted) Global action_reversed; ! (parameters would be reversed in order) Global wn; ! word number within "parse" buffer (from 1) Global num_words; ! number of words in buffer Global verb_word; ! dictionary address of command verb Global verb_wordnum; ! word number of command verb ! [10] Global scope_reason = PARSING_REASON; ! current reason for searching scope Global scope_token; ! for "scope=Routine" grammar tokens Global scope_error; Global scope_stage; ! 1, 2 then 3 Global advance_warning; ! what a later-named thing will be Global reason_code = NULL; ! for the I6 veneer Global ats_flag = 0; ! for AddToScope routines Global ats_hls; ! [11] Global move_pushing; Global move_from; Global move_to; Global move_by; Global move_through; ! [12] Global lookmode = 1; ! 1 = standard, 2 = verbose, 3 = brief room descriptions Global c_style; ! current list-writer style Global c_depth; ! current recursion depth Global c_iterator; ! current iteration function Global lt_value; ! common value of list_together Global listing_together; ! object number of one member of a group being listed together Global listing_size; ! size of such a group Global c_margin; ! current level of indentation printed by WriteListFrom() Global inventory_stage = 1; ! 1 or 2 according to the context in which list_together uses ! [13] Global clr_fg = 1; ! foreground colour Global clr_bg = 1; ! background colour Global clr_fgstatus = 1; ! foreground colour of statusline Global clr_bgstatus = 1; ! background colour of statusline Global clr_on; ! has colour been enabled by the player? Global statuswin_current; ! if writing to top window ! [14] Global statuswin_cursize = 0; Global statuswin_size = 1; ! [15] Global lm_act; Global lm_n; Global lm_o; Global lm_o2; ! [16] Global debug_flag = 0; Global debug_rules = 0; Global debug_scenes = 0; Global debug_rule_nesting; #Ifdef TARGET_GLULX; Array gg_event --> 4; Array gg_arguments buffer 28; Global gg_mainwin = 0; Global gg_statuswin = 0; Global gg_quotewin = 0; Global gg_scriptfref = 0; Global gg_scriptstr = 0; Global gg_savestr = 0; Global gg_commandstr = 0; Global gg_command_reading = 0; ! true if gg_commandstr is being replayed Global gg_foregroundchan = 0; Global gg_backgroundchan = 0; Constant INPUT_BUFFER_LEN = 260; ! No extra byte necessary Constant MAX_BUFFER_WORDS = 20; Constant PARSE_BUFFER_LEN = 61; Array buffer buffer INPUT_BUFFER_LEN; Array buffer2 buffer INPUT_BUFFER_LEN; Array buffer3 buffer INPUT_BUFFER_LEN; Array parse --> PARSE_BUFFER_LEN; Array parse2 --> PARSE_BUFFER_LEN; #IFNDEF infglk_h; ! Standard Glulx definitions contributed by John Cater Constant infglk_h; !------------------------------------------------------------------------------- ! infglk.h - an Inform library to allow easy access to glk functions ! under glulx ! Dynamically created by glk2inf.pl on 08/31/2006 at 19:20:21. ! Send comments or suggestions to: katre@ruf.rice.edu !------------------------------------------------------------------------------- #Ifdef infglk_h; ! remove "Constant declared but not used" warnings #Endif; Constant GLK_NULL 0; ! Constant definitions from glk.h Constant gestalt_Version 0; Constant gestalt_CharInput 1; Constant gestalt_LineInput 2; Constant gestalt_CharOutput 3; Constant gestalt_CharOutput_CannotPrint 0; Constant gestalt_CharOutput_ApproxPrint 1; Constant gestalt_CharOutput_ExactPrint 2; Constant gestalt_MouseInput 4; Constant gestalt_Timer 5; Constant gestalt_Graphics 6; Constant gestalt_DrawImage 7; Constant gestalt_Sound 8; Constant gestalt_SoundVolume 9; Constant gestalt_SoundNotify 10; Constant gestalt_Hyperlinks 11; Constant gestalt_HyperlinkInput 12; Constant gestalt_SoundMusic 13; Constant gestalt_GraphicsTransparency 14; Constant gestalt_Unicode 15; Constant evtype_None 0; Constant evtype_Timer 1; Constant evtype_CharInput 2; Constant evtype_LineInput 3; Constant evtype_MouseInput 4; Constant evtype_Arrange 5; Constant evtype_Redraw 6; Constant evtype_SoundNotify 7; Constant evtype_Hyperlink 8; Constant keycode_Unknown $ffffffff; Constant keycode_Left $fffffffe; Constant keycode_Right $fffffffd; Constant keycode_Up $fffffffc; Constant keycode_Down $fffffffb; Constant keycode_Return $fffffffa; Constant keycode_Delete $fffffff9; Constant keycode_Escape $fffffff8; Constant keycode_Tab $fffffff7; Constant keycode_PageUp $fffffff6; Constant keycode_PageDown $fffffff5; Constant keycode_Home $fffffff4; Constant keycode_End $fffffff3; Constant keycode_Func1 $ffffffef; Constant keycode_Func2 $ffffffee; Constant keycode_Func3 $ffffffed; Constant keycode_Func4 $ffffffec; Constant keycode_Func5 $ffffffeb; Constant keycode_Func6 $ffffffea; Constant keycode_Func7 $ffffffe9; Constant keycode_Func8 $ffffffe8; Constant keycode_Func9 $ffffffe7; Constant keycode_Func10 $ffffffe6; Constant keycode_Func11 $ffffffe5; Constant keycode_Func12 $ffffffe4; Constant keycode_MAXVAL 28; Constant style_Normal 0; Constant style_Emphasized 1; Constant style_Preformatted 2; Constant style_Header 3; Constant style_Subheader 4; Constant style_Alert 5; Constant style_Note 6; Constant style_BlockQuote 7; Constant style_Input 8; Constant style_User1 9; Constant style_User2 10; Constant style_NUMSTYLES 11; Constant wintype_AllTypes 0; Constant wintype_Pair 1; Constant wintype_Blank 2; Constant wintype_TextBuffer 3; Constant wintype_TextGrid 4; Constant wintype_Graphics 5; Constant winmethod_Left $00; Constant winmethod_Right $01; Constant winmethod_Above $02; Constant winmethod_Below $03; Constant winmethod_DirMask $0f; Constant winmethod_Fixed $10; Constant winmethod_Proportional $20; Constant winmethod_DivisionMask $f0; Constant fileusage_Data $00; Constant fileusage_SavedGame $01; Constant fileusage_Transcript $02; Constant fileusage_InputRecord $03; Constant fileusage_TypeMask $0f; Constant fileusage_TextMode $100; Constant fileusage_BinaryMode $000; Constant filemode_Write $01; Constant filemode_Read $02; Constant filemode_ReadWrite $03; Constant filemode_WriteAppend $05; Constant seekmode_Start 0; Constant seekmode_Current 1; Constant seekmode_End 2; Constant stylehint_Indentation 0; Constant stylehint_ParaIndentation 1; Constant stylehint_Justification 2; Constant stylehint_Size 3; Constant stylehint_Weight 4; Constant stylehint_Oblique 5; Constant stylehint_Proportional 6; Constant stylehint_TextColor 7; Constant stylehint_BackColor 8; Constant stylehint_ReverseColor 9; Constant stylehint_NUMHINTS 10; Constant stylehint_just_LeftFlush 0; Constant stylehint_just_LeftRight 1; Constant stylehint_just_Centered 2; Constant stylehint_just_RightFlush 3; Constant imagealign_InlineUp $01; Constant imagealign_InlineDown $02; Constant imagealign_InlineCenter $03; Constant imagealign_MarginLeft $04; Constant imagealign_MarginRight $05; ! The actual glk functions. [ glk_exit _vararg_count ret; ! glk_exit () ! And now the @glk call @glk 1 _vararg_count ret; return ret; ]; [ glk_set_interrupt_handler _vararg_count ret; ! glk_set_interrupt_handler (func) ! And now the @glk call @glk 2 _vararg_count ret; return ret; ]; [ glk_tick _vararg_count ret; ! glk_tick () ! And now the @glk call @glk 3 _vararg_count ret; return ret; ]; [ glk_gestalt _vararg_count ret; ! glk_gestalt (sel val) ! And now the @glk call @glk 4 _vararg_count ret; return ret; ]; [ glk_gestalt_ext _vararg_count ret; ! glk_gestalt_ext (sel val arr arrlen) ! And now the @glk call @glk 5 _vararg_count ret; return ret; ]; [ glk_char_to_lower _vararg_count ret; ! glk_char_to_lower (ch) ! And now the @glk call @glk 160 _vararg_count ret; return ret; ]; [ glk_char_to_upper _vararg_count ret; ! glk_char_to_upper (ch) ! And now the @glk call @glk 161 _vararg_count ret; return ret; ]; [ glk_window_get_root _vararg_count ret; ! glk_window_get_root () ! And now the @glk call @glk 34 _vararg_count ret; return ret; ]; [ glk_window_open _vararg_count ret; ! glk_window_open (split method size wintype rock) ! And now the @glk call @glk 35 _vararg_count ret; return ret; ]; [ glk_window_close _vararg_count ret; ! glk_window_close (win result) ! And now the @glk call @glk 36 _vararg_count ret; return ret; ]; [ glk_window_get_size _vararg_count ret; ! glk_window_get_size (win widthptr heightptr) ! And now the @glk call @glk 37 _vararg_count ret; return ret; ]; [ glk_window_set_arrangement _vararg_count ret; ! glk_window_set_arrangement (win method size keywin) ! And now the @glk call @glk 38 _vararg_count ret; return ret; ]; [ glk_window_get_arrangement _vararg_count ret; ! glk_window_get_arrangement (win methodptr sizeptr keywinptr) ! And now the @glk call @glk 39 _vararg_count ret; return ret; ]; [ glk_window_iterate _vararg_count ret; ! glk_window_iterate (win rockptr) ! And now the @glk call @glk 32 _vararg_count ret; return ret; ]; [ glk_window_get_rock _vararg_count ret; ! glk_window_get_rock (win) ! And now the @glk call @glk 33 _vararg_count ret; return ret; ]; [ glk_window_get_type _vararg_count ret; ! glk_window_get_type (win) ! And now the @glk call @glk 40 _vararg_count ret; return ret; ]; [ glk_window_get_parent _vararg_count ret; ! glk_window_get_parent (win) ! And now the @glk call @glk 41 _vararg_count ret; return ret; ]; [ glk_window_get_sibling _vararg_count ret; ! glk_window_get_sibling (win) ! And now the @glk call @glk 48 _vararg_count ret; return ret; ]; [ glk_window_clear _vararg_count ret; ! glk_window_clear (win) ! And now the @glk call @glk 42 _vararg_count ret; return ret; ]; [ glk_window_move_cursor _vararg_count ret; ! glk_window_move_cursor (win xpos ypos) ! And now the @glk call @glk 43 _vararg_count ret; return ret; ]; [ glk_window_get_stream _vararg_count ret; ! glk_window_get_stream (win) ! And now the @glk call @glk 44 _vararg_count ret; return ret; ]; [ glk_window_set_echo_stream _vararg_count ret; ! glk_window_set_echo_stream (win str) ! And now the @glk call @glk 45 _vararg_count ret; return ret; ]; [ glk_window_get_echo_stream _vararg_count ret; ! glk_window_get_echo_stream (win) ! And now the @glk call @glk 46 _vararg_count ret; return ret; ]; [ glk_set_window _vararg_count ret; ! glk_set_window (win) ! And now the @glk call @glk 47 _vararg_count ret; return ret; ]; [ glk_stream_open_file _vararg_count ret; ! glk_stream_open_file (fileref fmode rock) ! And now the @glk call @glk 66 _vararg_count ret; return ret; ]; [ glk_stream_open_memory _vararg_count ret; ! glk_stream_open_memory (buf buflen fmode rock) ! And now the @glk call @glk 67 _vararg_count ret; return ret; ]; [ glk_stream_close _vararg_count ret; ! glk_stream_close (str result) ! And now the @glk call @glk 68 _vararg_count ret; return ret; ]; [ glk_stream_iterate _vararg_count ret; ! glk_stream_iterate (str rockptr) ! And now the @glk call @glk 64 _vararg_count ret; return ret; ]; [ glk_stream_get_rock _vararg_count ret; ! glk_stream_get_rock (str) ! And now the @glk call @glk 65 _vararg_count ret; return ret; ]; [ glk_stream_set_position _vararg_count ret; ! glk_stream_set_position (str pos seekmode) ! And now the @glk call @glk 69 _vararg_count ret; return ret; ]; [ glk_stream_get_position _vararg_count ret; ! glk_stream_get_position (str) ! And now the @glk call @glk 70 _vararg_count ret; return ret; ]; [ glk_stream_set_current _vararg_count ret; ! glk_stream_set_current (str) ! And now the @glk call @glk 71 _vararg_count ret; return ret; ]; [ glk_stream_get_current _vararg_count ret; ! glk_stream_get_current () ! And now the @glk call @glk 72 _vararg_count ret; return ret; ]; [ glk_put_char _vararg_count ret; ! glk_put_char (ch) ! And now the @glk call @glk 128 _vararg_count ret; return ret; ]; [ glk_put_char_stream _vararg_count ret; ! glk_put_char_stream (str ch) ! And now the @glk call @glk 129 _vararg_count ret; return ret; ]; [ glk_put_string _vararg_count ret; ! glk_put_string (s) ! And now the @glk call @glk 130 _vararg_count ret; return ret; ]; [ glk_put_string_stream _vararg_count ret; ! glk_put_string_stream (str s) ! And now the @glk call @glk 131 _vararg_count ret; return ret; ]; [ glk_put_buffer _vararg_count ret; ! glk_put_buffer (buf len) ! And now the @glk call @glk 132 _vararg_count ret; return ret; ]; [ glk_put_buffer_stream _vararg_count ret; ! glk_put_buffer_stream (str buf len) ! And now the @glk call @glk 133 _vararg_count ret; return ret; ]; [ glk_set_style _vararg_count ret; ! glk_set_style (styl) ! And now the @glk call @glk 134 _vararg_count ret; return ret; ]; [ glk_set_style_stream _vararg_count ret; ! glk_set_style_stream (str styl) ! And now the @glk call @glk 135 _vararg_count ret; return ret; ]; [ glk_get_char_stream _vararg_count ret; ! glk_get_char_stream (str) ! And now the @glk call @glk 144 _vararg_count ret; return ret; ]; [ glk_get_line_stream _vararg_count ret; ! glk_get_line_stream (str buf len) ! And now the @glk call @glk 145 _vararg_count ret; return ret; ]; [ glk_get_buffer_stream _vararg_count ret; ! glk_get_buffer_stream (str buf len) ! And now the @glk call @glk 146 _vararg_count ret; return ret; ]; [ glk_stylehint_set _vararg_count ret; ! glk_stylehint_set (wintype styl hint val) ! And now the @glk call @glk 176 _vararg_count ret; return ret; ]; [ glk_stylehint_clear _vararg_count ret; ! glk_stylehint_clear (wintype styl hint) ! And now the @glk call @glk 177 _vararg_count ret; return ret; ]; [ glk_style_distinguish _vararg_count ret; ! glk_style_distinguish (win styl1 styl2) ! And now the @glk call @glk 178 _vararg_count ret; return ret; ]; [ glk_style_measure _vararg_count ret; ! glk_style_measure (win styl hint result) ! And now the @glk call @glk 179 _vararg_count ret; return ret; ]; [ glk_fileref_create_temp _vararg_count ret; ! glk_fileref_create_temp (usage rock) ! And now the @glk call @glk 96 _vararg_count ret; return ret; ]; [ glk_fileref_create_by_name _vararg_count ret; ! glk_fileref_create_by_name (usage name rock) ! And now the @glk call @glk 97 _vararg_count ret; return ret; ]; [ glk_fileref_create_by_prompt _vararg_count ret; ! glk_fileref_create_by_prompt (usage fmode rock) ! And now the @glk call @glk 98 _vararg_count ret; return ret; ]; [ glk_fileref_create_from_fileref _vararg_count ret; ! glk_fileref_create_from_fileref (usage fref rock) ! And now the @glk call @glk 104 _vararg_count ret; return ret; ]; [ glk_fileref_destroy _vararg_count ret; ! glk_fileref_destroy (fref) ! And now the @glk call @glk 99 _vararg_count ret; return ret; ]; [ glk_fileref_iterate _vararg_count ret; ! glk_fileref_iterate (fref rockptr) ! And now the @glk call @glk 100 _vararg_count ret; return ret; ]; [ glk_fileref_get_rock _vararg_count ret; ! glk_fileref_get_rock (fref) ! And now the @glk call @glk 101 _vararg_count ret; return ret; ]; [ glk_fileref_delete_file _vararg_count ret; ! glk_fileref_delete_file (fref) ! And now the @glk call @glk 102 _vararg_count ret; return ret; ]; [ glk_fileref_does_file_exist _vararg_count ret; ! glk_fileref_does_file_exist (fref) ! And now the @glk call @glk 103 _vararg_count ret; return ret; ]; [ glk_select _vararg_count ret; ! glk_select (event) ! And now the @glk call @glk 192 _vararg_count ret; return ret; ]; [ glk_select_poll _vararg_count ret; ! glk_select_poll (event) ! And now the @glk call @glk 193 _vararg_count ret; return ret; ]; [ glk_request_timer_events _vararg_count ret; ! glk_request_timer_events (millisecs) ! And now the @glk call @glk 214 _vararg_count ret; return ret; ]; [ glk_request_line_event _vararg_count ret; ! glk_request_line_event (win buf maxlen initlen) ! And now the @glk call @glk 208 _vararg_count ret; return ret; ]; [ glk_request_char_event _vararg_count ret; ! glk_request_char_event (win) ! And now the @glk call @glk 210 _vararg_count ret; return ret; ]; [ glk_request_mouse_event _vararg_count ret; ! glk_request_mouse_event (win) ! And now the @glk call @glk 212 _vararg_count ret; return ret; ]; [ glk_cancel_line_event _vararg_count ret; ! glk_cancel_line_event (win event) ! And now the @glk call @glk 209 _vararg_count ret; return ret; ]; [ glk_cancel_char_event _vararg_count ret; ! glk_cancel_char_event (win) ! And now the @glk call @glk 211 _vararg_count ret; return ret; ]; [ glk_cancel_mouse_event _vararg_count ret; ! glk_cancel_mouse_event (win) ! And now the @glk call @glk 213 _vararg_count ret; return ret; ]; [ glk_buffer_to_lower_case_uni _vararg_count ret; ! glk_buffer_to_lower_case_uni (buf len numchars) ! And now the @glk call @glk 288 _vararg_count ret; return ret; ]; [ glk_buffer_to_upper_case_uni _vararg_count ret; ! glk_buffer_to_upper_case_uni (buf len numchars) ! And now the @glk call @glk 289 _vararg_count ret; return ret; ]; [ glk_buffer_to_title_case_uni _vararg_count ret; ! glk_buffer_to_title_case_uni (buf len numchars lowerrest) ! And now the @glk call @glk 290 _vararg_count ret; return ret; ]; [ glk_put_char_uni _vararg_count ret; ! glk_put_char_uni (ch) ! And now the @glk call @glk 296 _vararg_count ret; return ret; ]; [ glk_put_string_uni _vararg_count ret; ! glk_put_string_uni (s) ! And now the @glk call @glk 297 _vararg_count ret; return ret; ]; [ glk_put_buffer_uni _vararg_count ret; ! glk_put_buffer_uni (buf len) ! And now the @glk call @glk 298 _vararg_count ret; return ret; ]; [ glk_put_char_stream_uni _vararg_count ret; ! glk_put_char_stream_uni (str ch) ! And now the @glk call @glk 299 _vararg_count ret; return ret; ]; [ glk_put_string_stream_uni _vararg_count ret; ! glk_put_string_stream_uni (str s) ! And now the @glk call @glk 300 _vararg_count ret; return ret; ]; [ glk_put_buffer_stream_uni _vararg_count ret; ! glk_put_buffer_stream_uni (str buf len) ! And now the @glk call @glk 301 _vararg_count ret; return ret; ]; [ glk_get_char_stream_uni _vararg_count ret; ! glk_get_char_stream_uni (str) ! And now the @glk call @glk 304 _vararg_count ret; return ret; ]; [ glk_get_buffer_stream_uni _vararg_count ret; ! glk_get_buffer_stream_uni (str buf len) ! And now the @glk call @glk 305 _vararg_count ret; return ret; ]; [ glk_get_line_stream_uni _vararg_count ret; ! glk_get_line_stream_uni (str buf len) ! And now the @glk call @glk 306 _vararg_count ret; return ret; ]; [ glk_stream_open_file_uni _vararg_count ret; ! glk_stream_open_file_uni (fileref fmode rock) ! And now the @glk call @glk 312 _vararg_count ret; return ret; ]; [ glk_stream_open_memory_uni _vararg_count ret; ! glk_stream_open_memory_uni (buf buflen fmode rock) ! And now the @glk call @glk 313 _vararg_count ret; return ret; ]; [ glk_request_char_event_uni _vararg_count ret; ! glk_request_char_event_uni (win) ! And now the @glk call @glk 320 _vararg_count ret; return ret; ]; [ glk_request_line_event_uni _vararg_count ret; ! glk_request_line_event_uni (win buf maxlen initlen) ! And now the @glk call @glk 321 _vararg_count ret; return ret; ]; [ glk_image_draw _vararg_count ret; ! glk_image_draw (win image val1 val2) ! And now the @glk call @glk 225 _vararg_count ret; return ret; ]; [ glk_image_draw_scaled _vararg_count ret; ! glk_image_draw_scaled (win image val1 val2 width height) ! And now the @glk call @glk 226 _vararg_count ret; return ret; ]; [ glk_image_get_info _vararg_count ret; ! glk_image_get_info (image width height) ! And now the @glk call @glk 224 _vararg_count ret; return ret; ]; [ glk_window_flow_break _vararg_count ret; ! glk_window_flow_break (win) ! And now the @glk call @glk 232 _vararg_count ret; return ret; ]; [ glk_window_erase_rect _vararg_count ret; ! glk_window_erase_rect (win left top width height) ! And now the @glk call @glk 233 _vararg_count ret; return ret; ]; [ glk_window_fill_rect _vararg_count ret; ! glk_window_fill_rect (win color left top width height) ! And now the @glk call @glk 234 _vararg_count ret; return ret; ]; [ glk_window_set_background_color _vararg_count ret; ! glk_window_set_background_color (win color) ! And now the @glk call @glk 235 _vararg_count ret; return ret; ]; [ glk_schannel_create _vararg_count ret; ! glk_schannel_create (rock) ! And now the @glk call @glk 242 _vararg_count ret; return ret; ]; [ glk_schannel_destroy _vararg_count ret; ! glk_schannel_destroy (chan) ! And now the @glk call @glk 243 _vararg_count ret; return ret; ]; [ glk_schannel_iterate _vararg_count ret; ! glk_schannel_iterate (chan rockptr) ! And now the @glk call @glk 240 _vararg_count ret; return ret; ]; [ glk_schannel_get_rock _vararg_count ret; ! glk_schannel_get_rock (chan) ! And now the @glk call @glk 241 _vararg_count ret; return ret; ]; [ glk_schannel_play _vararg_count ret; ! glk_schannel_play (chan snd) ! And now the @glk call @glk 248 _vararg_count ret; return ret; ]; [ glk_schannel_play_ext _vararg_count ret; ! glk_schannel_play_ext (chan snd repeats notify) ! And now the @glk call @glk 249 _vararg_count ret; return ret; ]; [ glk_schannel_stop _vararg_count ret; ! glk_schannel_stop (chan) ! And now the @glk call @glk 250 _vararg_count ret; return ret; ]; [ glk_schannel_set_volume _vararg_count ret; ! glk_schannel_set_volume (chan vol) ! And now the @glk call @glk 251 _vararg_count ret; return ret; ]; [ glk_sound_load_hint _vararg_count ret; ! glk_sound_load_hint (snd flag) ! And now the @glk call @glk 252 _vararg_count ret; return ret; ]; [ glk_set_hyperlink _vararg_count ret; ! glk_set_hyperlink (linkval) ! And now the @glk call @glk 256 _vararg_count ret; return ret; ]; [ glk_set_hyperlink_stream _vararg_count ret; ! glk_set_hyperlink_stream (str linkval) ! And now the @glk call @glk 257 _vararg_count ret; return ret; ]; [ glk_request_hyperlink_event _vararg_count ret; ! glk_request_hyperlink_event (win) ! And now the @glk call @glk 258 _vararg_count ret; return ret; ]; [ glk_cancel_hyperlink_event _vararg_count ret; ! glk_cancel_hyperlink_event (win) ! And now the @glk call @glk 259 _vararg_count ret; return ret; ]; #ENDIF; Constant GG_MAINWIN_ROCK 201; Constant GG_STATUSWIN_ROCK 202; Constant GG_QUOTEWIN_ROCK 203; Constant GG_SAVESTR_ROCK 301; Constant GG_SCRIPTSTR_ROCK 302; Constant GG_COMMANDWSTR_ROCK 303; Constant GG_COMMANDRSTR_ROCK 304; Constant GG_SCRIPTFREF_ROCK 401; Constant GG_FOREGROUNDCHAN_ROCK 410; Constant GG_BACKGROUNDCHAN_ROCK 411; #Stub HandleGlkEvent 2; #Stub IdentifyGlkObject 4; #Stub InitGlkWindow 1; [ VM_Initialise res sty; @gestalt 4 2 res; ! Test if this interpreter has Glk... if (res == 0) quit; ! ...without which there would be nothing we could do unicode_gestalt_ok = false; if (glk_gestalt(gestalt_Unicode, 0)) unicode_gestalt_ok = true; ! Set the VM's I/O system to be Glk. @setiosys 2 0; ! First, we must go through all the Glk objects that exist, and see ! if we created any of them. One might think this strange, since the ! program has just started running, but remember that the player might ! have just typed "restart". GGRecoverObjects(); ! Sound channel initialisation, and RNG fixing, must be done now rather ! than later in case InitGlkWindow() returns a non-zero value. if (glk_gestalt(gestalt_Sound, 0)) { if (gg_foregroundchan == 0) gg_foregroundchan = glk_schannel_create(GG_FOREGROUNDCHAN_ROCK); if (gg_backgroundchan == 0) gg_backgroundchan = glk_schannel_create(GG_BACKGROUNDCHAN_ROCK); } #ifdef FIX_RNG; @random 10000 i; i = -i-2000; print "[Random number generator seed is ", i, "]^"; @setrandom i; #endif; ! FIX_RNG res = InitGlkWindow(0); if (res ~= 0) return; ! Now, gg_mainwin and gg_storywin might already be set. If not, set them. if (gg_mainwin == 0) { ! Open the story window. res = InitGlkWindow(GG_MAINWIN_ROCK); if (res == 0) { ! Left-justify the header style glk_stylehint_set(wintype_TextBuffer, style_Header, stylehint_Justification, 0); ! Try to make emphasized type in italics and not boldface glk_stylehint_set(wintype_TextBuffer, style_Emphasized, stylehint_Weight, 0); glk_stylehint_set(wintype_TextBuffer, style_Emphasized, stylehint_Oblique, 1); gg_mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, GG_MAINWIN_ROCK); } if (gg_mainwin == 0) quit; ! If we can't even open one window, give in } else { ! There was already a story window. We should erase it. glk_window_clear(gg_mainwin); } if (gg_statuswin == 0) { res = InitGlkWindow(GG_STATUSWIN_ROCK); if (res == 0) { statuswin_cursize = statuswin_size; for (sty=0: sty0) { GG_SAVESTR_ROCK: gg_savestr = id; GG_SCRIPTSTR_ROCK: gg_scriptstr = id; #Ifdef DEBUG; GG_COMMANDWSTR_ROCK: gg_commandstr = id; gg_command_reading = false; GG_COMMANDRSTR_ROCK: gg_commandstr = id; gg_command_reading = true; #Endif; ! DEBUG default: IdentifyGlkObject(1, 1, id, gg_arguments-->0); } id = glk_stream_iterate(id, gg_arguments); } id = glk_window_iterate(0, gg_arguments); while (id) { switch (gg_arguments-->0) { GG_MAINWIN_ROCK: gg_mainwin = id; GG_STATUSWIN_ROCK: gg_statuswin = id; GG_QUOTEWIN_ROCK: gg_quotewin = id; default: IdentifyGlkObject(1, 0, id, gg_arguments-->0); } id = glk_window_iterate(id, gg_arguments); } id = glk_fileref_iterate(0, gg_arguments); while (id) { switch (gg_arguments-->0) { GG_SCRIPTFREF_ROCK: gg_scriptfref = id; default: IdentifyGlkObject(1, 2, id, gg_arguments-->0); } id = glk_fileref_iterate(id, gg_arguments); } if (glk_gestalt(gestalt_Sound, 0)) { id = glk_schannel_iterate(0, gg_arguments); while (id) { switch (gg_arguments-->0) { GG_FOREGROUNDCHAN_ROCK: gg_foregroundchan = id; GG_BACKGROUNDCHAN_ROCK: gg_backgroundchan = id; } id = glk_schannel_iterate(id, gg_arguments); } if (gg_foregroundchan ~= 0) { glk_schannel_stop(gg_foregroundchan); } if (gg_backgroundchan ~= 0) { glk_schannel_stop(gg_backgroundchan); } } ! Tell the game to tie up any loose ends. IdentifyGlkObject(2); ]; [ ENABLE_GLULX_ACCEL_R addr res; @gestalt 9 0 res; if (res == 0) return; addr = #classes_table; @accelparam 0 addr; @accelparam 1 INDIV_PROP_START; @accelparam 2 Class; @accelparam 3 Object; @accelparam 4 Routine; @accelparam 5 String; addr = #globals_array + WORDSIZE * #g$self; @accelparam 6 addr; @accelparam 7 NUM_ATTR_BYTES; addr = #cpv__start; @accelparam 8 addr; @accelfunc 1 Z__Region; @accelfunc 2 CP__Tab; @accelfunc 3 RA__Pr; @accelfunc 4 RL__Pr; @accelfunc 5 OC__Cl; @accelfunc 6 RV__Pr; @accelfunc 7 OP__Pr; rfalse; ]; [ VM_Describe_Release i; print "Release "; @aloads ROM_GAMERELEASE 0 i; print i; print " / Serial number "; for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i; ]; [ VM_KeyChar win nostat done res ix jx ch; jx = ch; ! squash compiler warnings if (win == 0) win = gg_mainwin; if (gg_commandstr ~= 0 && gg_command_reading ~= false) { done = glk_get_line_stream(gg_commandstr, gg_arguments, 31); if (done == 0) { glk_stream_close(gg_commandstr, 0); gg_commandstr = 0; gg_command_reading = false; ! fall through to normal user input. } else { ! Trim the trailing newline if (gg_arguments->(done-1) == 10) done = done-1; res = gg_arguments->0; if (res == '\') { res = 0; for (ix=1 : ixix; if (ch >= '0' && ch <= '9') { @shiftl res 4 res; res = res + (ch-'0'); } else if (ch >= 'a' && ch <= 'f') { @shiftl res 4 res; res = res + (ch+10-'a'); } else if (ch >= 'A' && ch <= 'F') { @shiftl res 4 res; res = res + (ch+10-'A'); } } } jump KCPContinue; } } done = false; glk_request_char_event(win); while (~~done) { glk_select(gg_event); switch (gg_event-->0) { 5: ! evtype_Arrange if (nostat) { glk_cancel_char_event(win); res = $80000000; done = true; break; } DrawStatusLine(); 2: ! evtype_CharInput if (gg_event-->1 == win) { res = gg_event-->2; done = true; } } ix = HandleGlkEvent(gg_event, 1, gg_arguments); if (ix == 2) { res = gg_arguments-->0; done = true; } else if (ix == -1) done = false; } if (gg_commandstr ~= 0 && gg_command_reading == false) { if (res < 32 || res >= 256 || (res == '\' or ' ')) { glk_put_char_stream(gg_commandstr, '\'); done = 0; jx = res; for (ix=0 : ix<8 : ix++) { @ushiftr jx 28 ch; @shiftl jx 4 jx; ch = ch & $0F; if (ch ~= 0 || ix == 7) done = 1; if (done) { if (ch >= 0 && ch <= 9) ch = ch + '0'; else ch = (ch - 10) + 'A'; glk_put_char_stream(gg_commandstr, ch); } } } else { glk_put_char_stream(gg_commandstr, res); } glk_put_char_stream(gg_commandstr, 10); ! newline } .KCPContinue; return res; ]; [ VM_KeyDelay tenths key done ix; glk_request_char_event(gg_mainwin); glk_request_timer_events(tenths*100); while (~~done) { glk_select(gg_event); ix = HandleGlkEvent(gg_event, 1, gg_arguments); if (ix == 2) { key = gg_arguments-->0; done = true; } else if (ix >= 0 && gg_event-->0 == 1 or 2) { key = gg_event-->2; done = true; } } glk_cancel_char_event(gg_mainwin); glk_request_timer_events(0); return key; ]; [ VM_ReadKeyboard a_buffer a_table done ix; if (gg_commandstr ~= 0 && gg_command_reading ~= false) { done = glk_get_line_stream(gg_commandstr, a_buffer+WORDSIZE, (INPUT_BUFFER_LEN-WORDSIZE)-1); if (done == 0) { glk_stream_close(gg_commandstr, 0); gg_commandstr = 0; gg_command_reading = false; ! L__M(##CommandsRead, 5); would come after prompt ! fall through to normal user input. } else { ! Trim the trailing newline if ((a_buffer+WORDSIZE)->(done-1) == 10) done = done-1; a_buffer-->0 = done; VM_Style(INPUT_VMSTY); glk_put_buffer(a_buffer+WORDSIZE, done); VM_Style(NORMAL_VMSTY); print "^"; jump KPContinue; } } done = false; glk_request_line_event(gg_mainwin, a_buffer+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, 0); while (~~done) { glk_select(gg_event); switch (gg_event-->0) { 5: ! evtype_Arrange DrawStatusLine(); 3: ! evtype_LineInput if (gg_event-->1 == gg_mainwin) { a_buffer-->0 = gg_event-->2; done = true; } } ix = HandleGlkEvent(gg_event, 0, a_buffer); if (ix == 2) done = true; else if (ix == -1) done = false; } if (gg_commandstr ~= 0 && gg_command_reading == false) { glk_put_buffer_stream(gg_commandstr, a_buffer+WORDSIZE, a_buffer-->0); glk_put_char_stream(gg_commandstr, 10); ! newline } .KPContinue; VM_Tokenise(a_buffer,a_table); ! It's time to close any quote window we've got going. if (gg_quotewin) { glk_window_close(gg_quotewin, 0); gg_quotewin = 0; } #ifdef ECHO_COMMANDS; print "** "; for (ix=WORDSIZE: ix<(a_buffer-->0)+WORDSIZE: ix++) print (char) a_buffer->ix; print "^"; #endif; ! ECHO_COMMANDS ]; [ VM_CopyBuffer bto bfrom i; for (i=0: ii = bfrom->i; ]; [ VM_PrintToBuffer buf len a b c; if (b) { if (metaclass(a) == Object && a.#b == WORDSIZE && metaclass(a.b) == String) buf-->0 = Glulx_PrintAnyToArray(buf+WORDSIZE, len, a.b); else if (metaclass(a) == Routine) buf-->0 = Glulx_PrintAnyToArray(buf+WORDSIZE, len, a, b, c); else buf-->0 = Glulx_PrintAnyToArray(buf+WORDSIZE, len, a, b); } else if (metaclass(a) == Routine) buf-->0 = Glulx_PrintAnyToArray(buf+WORDSIZE, len, a, b, c); else buf-->0 = Glulx_PrintAnyToArray(buf+WORDSIZE, len, a); if (buf-->0 > len) buf-->0 = len; return buf-->0; ]; [ VM_Tokenise buf tab cx numwords len bx ix wx wpos wlen val res dictlen entrylen; len = buf-->0; buf = buf+WORDSIZE; ! First, split the buffer up into words. We use the standard Infocom ! list of word separators (comma, period, double-quote). cx = 0; numwords = 0; while (cx < len) { while (cx < len && buf->cx == ' ') cx++; if (cx >= len) break; bx = cx; if (buf->cx == '.' or ',' or '"') cx++; else { while (cx < len && buf->cx ~= ' ' or '.' or ',' or '"') cx++; } tab-->(numwords*3+2) = (cx-bx); tab-->(numwords*3+3) = WORDSIZE+bx; numwords++; if (numwords >= MAX_BUFFER_WORDS) break; } tab-->0 = numwords; ! Now we look each word up in the dictionary. dictlen = #dictionary_table-->0; entrylen = DICT_WORD_SIZE + 7; for (wx=0 : wx(wx*3+2); wpos = tab-->(wx*3+3); ! Copy the word into the gg_tokenbuf array, clipping to DICT_WORD_SIZE ! characters and lower case. if (wlen > DICT_WORD_SIZE) wlen = DICT_WORD_SIZE; cx = wpos - WORDSIZE; for (ix=0 : ixix = VM_UpperToLowerCase(buf->(cx+ix)); for (: ixix = 0; val = #dictionary_table + WORDSIZE; @binarysearch gg_tokenbuf DICT_WORD_SIZE val entrylen dictlen 1 1 res; tab-->(wx*3+1) = res; } ]; [ LTI_Insert i ch b y; ! Protect us from strict mode, as this isn't an array in quite the ! sense it expects b = buffer; ! Insert character ch into buffer at point i. ! Being careful not to let the buffer possibly overflow: y = b-->0; if (y > INPUT_BUFFER_LEN) y = INPUT_BUFFER_LEN; ! Move the subsequent text along one character: for (y=y+WORDSIZE : y>i : y--) b->y = b->(y-1); b->i = ch; ! And the text is now one character longer: if (b-->0 < INPUT_BUFFER_LEN) (b-->0)++; ]; [ VM_InvalidDictionaryAddress addr; if (addr < 0) rtrue; rfalse; ]; [ VM_DictionaryAddressToNumber w; return w; ]; [ VM_NumberToDictionaryAddress n; return n; ]; Array gg_tokenbuf -> DICT_WORD_SIZE; [ GGWordCompare str1 str2 ix jx; for (ix=0 : ixix) - (str2->ix); if (jx ~= 0) return jx; } return 0; ]; #Ifdef DEBUG; [ DebugAction a str; if (a >= 4096) { print ""; return; } if (a < 0 || a >= #identifiers_table-->7) print ""; else { str = #identifiers_table-->6; str = str-->a; if (str) print (string) str; else print ""; } ]; [ DebugAttribute a str; if (a < 0 || a >= NUM_ATTR_BYTES*8) print ""; else { str = #identifiers_table-->4; str = str-->a; if (str) print (string) str; else print ""; } ]; #Endif; [ VM_CommandTableAddress i; return (#grammar_table)-->(i+1); ]; [ VM_PrintCommandWords i wd j dictlen entrylen; dictlen = #dictionary_table-->0; entrylen = DICT_WORD_SIZE + 7; for (j=0 : j ! Glulx_PrintAnything(0) ! Glulx_PrintAnything("string"); print (string) "string"; ! Glulx_PrintAnything('word') print (address) 'word'; ! Glulx_PrintAnything(obj) print (name) obj; ! Glulx_PrintAnything(obj, prop) obj.prop(); ! Glulx_PrintAnything(obj, prop, args...) obj.prop(args...); ! Glulx_PrintAnything(func) func(); ! Glulx_PrintAnything(func, args...) func(args...); [ Glulx_PrintAnything _vararg_count obj mclass; if (_vararg_count == 0) return; @copy sp obj; _vararg_count--; if (obj == 0) return; if (obj->0 == $60) { ! Dictionary word. Metaclass() can't catch this case, so we do it manually print (address) obj; return; } mclass = metaclass(obj); switch (mclass) { nothing: return; String: print (string) obj; return; Routine: ! Call the function with all the arguments which are already ! on the stack. @call obj _vararg_count 0; return; Object: if (_vararg_count == 0) { print (name) obj; } else { ! Push the object back onto the stack, and call the ! veneer routine that handles obj.prop() calls. @copy obj sp; _vararg_count++; @call CA__Pr _vararg_count 0; } return; } ]; [ Glulx_PrintAnyToArray _vararg_count arr arrlen str oldstr len; @copy sp arr; @copy sp arrlen; _vararg_count = _vararg_count - 2; oldstr = glk_stream_get_current(); str = glk_stream_open_memory(arr, arrlen, 1, 0); if (str == 0) return 0; glk_stream_set_current(str); @call Glulx_PrintAnything _vararg_count 0; glk_stream_set_current(oldstr); @copy $ffffffff sp; @copy str sp; @glk $0044 2 0; ! stream_close @copy sp len; @copy sp 0; return len; ]; Constant GG_ANYTOSTRING_LEN 66; Array AnyToStrArr -> GG_ANYTOSTRING_LEN+1; [ Glulx_ChangeAnyToCString _vararg_count ix len; ix = GG_ANYTOSTRING_LEN-2; @copy ix sp; ix = AnyToStrArr+1; @copy ix sp; ix = _vararg_count+2; @call Glulx_PrintAnyToArray ix len; AnyToStrArr->0 = $E0; if (len >= GG_ANYTOSTRING_LEN) len = GG_ANYTOSTRING_LEN-1; AnyToStrArr->(len+1) = 0; return AnyToStrArr; ]; [ VM_ClearScreen window; if (window == WIN_ALL or WIN_MAIN) { glk_window_clear(gg_mainwin); if (gg_quotewin) { glk_window_close(gg_quotewin, 0); gg_quotewin = 0; } } if (gg_statuswin && window == WIN_ALL or WIN_STATUS) glk_window_clear(gg_statuswin); ]; [ VM_ScreenWidth id; id=gg_mainwin; if (gg_statuswin && statuswin_current) id = gg_statuswin; glk_window_get_size(id, gg_arguments, 0); return gg_arguments-->0; ]; [ VM_ScreenHeight; glk_window_get_size(gg_mainwin, 0, gg_arguments); return gg_arguments-->0; ]; [ VM_SetWindowColours f b window doclear i fwd bwd swin; if (clr_on && f && b) { if (window) swin = 5-window; ! 4 for TextGrid, 3 for TextBuffer fwd = MakeColourWord(f); bwd = MakeColourWord(b); for (i=0 : i 9) return c; c = c-2; return $ff0000*(c&1) + $ff00*(c&2 ~= 0) + $ff*(c&4 ~= 0); ]; [ VM_MainWindow; glk_set_window(gg_mainwin); ! set_window statuswin_current=0; ]; [ VM_StatusLineHeight hgt; if (gg_statuswin == 0) return; if (hgt == statuswin_cursize) return; glk_window_set_arrangement(glk_window_get_parent(gg_statuswin), $12, hgt, 0); statuswin_cursize = hgt; ]; [ VM_MoveCursorInStatusLine line column; if (gg_statuswin == 0) return; glk_set_window(gg_statuswin); if (line == 0) { line = 1; column = 1; } glk_window_move_cursor(gg_statuswin, column-1, line-1); statuswin_current=1; ]; [ Box__Routine maxwid arr ix lines lastnl parwin; maxwid = 0; ! squash compiler warning lines = arr-->0; if (gg_quotewin == 0) { gg_arguments-->0 = lines; ix = InitGlkWindow(GG_QUOTEWIN_ROCK); if (ix == 0) gg_quotewin = glk_window_open(gg_mainwin, winmethod_Fixed + winmethod_Above, lines, wintype_TextBuffer, GG_QUOTEWIN_ROCK); } else { parwin = glk_window_get_parent(gg_quotewin); glk_window_set_arrangement(parwin, $12, lines, 0); } lastnl = true; if (gg_quotewin) { glk_window_clear(gg_quotewin); glk_set_window(gg_quotewin); lastnl = false; } VM_Style(BLOCKQUOTE_VMSTY); for (ix=0 : ix(ix+1); if (ix < lines-1 || lastnl) new_line; } VM_Style(NORMAL_VMSTY); if (gg_quotewin) glk_set_window(gg_mainwin); ]; #Ifdef DEBUG; [ GlkListSub id val; id = glk_window_iterate(0, gg_arguments); while (id) { print "Window ", id, " (", gg_arguments-->0, "): "; val = glk_window_get_type(id); switch (val) { 1: print "pair"; 2: print "blank"; 3: print "textbuffer"; 4: print "textgrid"; 5: print "graphics"; default: print "unknown"; } val = glk_window_get_parent(id); if (val) print ", parent is window ", val; else print ", no parent (root)"; val = glk_window_get_stream(id); print ", stream ", val; val = glk_window_get_echo_stream(id); if (val) print ", echo stream ", val; print "^"; id = glk_window_iterate(id, gg_arguments); } id = glk_stream_iterate(0, gg_arguments); while (id) { print "Stream ", id, " (", gg_arguments-->0, ")^"; id = glk_stream_iterate(id, gg_arguments); } id = glk_fileref_iterate(0, gg_arguments); while (id) { print "Fileref ", id, " (", gg_arguments-->0, ")^"; id = glk_fileref_iterate(id, gg_arguments); } if (glk_gestalt(gestalt_Sound, 0)) { id = glk_schannel_iterate(0, gg_arguments); while (id) { print "Soundchannel ", id, " (", gg_arguments-->0, ")^"; id = glk_schannel_iterate(id, gg_arguments); } } ]; Verb meta 'glklist' * -> Glklist; #Endif; [ VM_Undo result_code; @restoreundo result_code; return (~~result_code); ]; [ VM_Save_Undo result_code; @saveundo result_code; if (result_code == -1) { GGRecoverObjects(); return 2; } return (~~result_code); ]; [ QUIT_THE_GAME_R; if (actor ~= player) rfalse; GL__M(##Quit, 2); if (YesOrNo()~=0) quit; ]; [ RESTART_THE_GAME_R; if (actor ~= player) rfalse; GL__M(##Restart, 1); if (YesOrNo() ~= 0) { @restart; GL__M(##Restart, 2); } ]; [ RESTORE_THE_GAME_R res fref; if (actor ~= player) rfalse; fref = glk_fileref_create_by_prompt($01, $02, 0); if (fref == 0) jump RFailed; gg_savestr = glk_stream_open_file(fref, $02, GG_SAVESTR_ROCK); glk_fileref_destroy(fref); if (gg_savestr == 0) jump RFailed; @restore gg_savestr res; glk_stream_close(gg_savestr, 0); gg_savestr = 0; .RFailed; GL__M(##Restore, 1); ]; [ SAVE_THE_GAME_R res fref; if (actor ~= player) rfalse; fref = glk_fileref_create_by_prompt($01, $01, 0); if (fref == 0) jump SFailed; gg_savestr = glk_stream_open_file(fref, $01, GG_SAVESTR_ROCK); glk_fileref_destroy(fref); if (gg_savestr == 0) jump SFailed; @save gg_savestr res; if (res == -1) { ! The player actually just typed "restore". We're going to print ! GL__M(##Restore,2); the Z-Code Inform library does this correctly ! now. But first, we have to recover all the Glk objects; the values ! in our global variables are all wrong. GGRecoverObjects(); glk_stream_close(gg_savestr, 0); ! stream_close gg_savestr = 0; return GL__M(##Restore, 2); } glk_stream_close(gg_savestr, 0); ! stream_close gg_savestr = 0; if (res == 0) return GL__M(##Save, 2); .SFailed; GL__M(##Save, 1); ]; [ VERIFY_THE_STORY_FILE_R res; if (actor ~= player) rfalse; @verify res; if (res == 0) return GL__M(##Verify, 1); GL__M(##Verify, 2); ]; [ SWITCH_TRANSCRIPT_ON_R; if (actor ~= player) rfalse; if (gg_scriptstr ~= 0) return GL__M(##ScriptOn, 1); if (gg_scriptfref == 0) { gg_scriptfref = glk_fileref_create_by_prompt($102, $05, GG_SCRIPTFREF_ROCK); if (gg_scriptfref == 0) jump S1Failed; } ! stream_open_file gg_scriptstr = glk_stream_open_file(gg_scriptfref, $05, GG_SCRIPTSTR_ROCK); if (gg_scriptstr == 0) jump S1Failed; glk_window_set_echo_stream(gg_mainwin, gg_scriptstr); GL__M(##ScriptOn, 2); VersionSub(); return; .S1Failed; GL__M(##ScriptOn, 3); ]; [ SWITCH_TRANSCRIPT_OFF_R; if (actor ~= player) rfalse; if (gg_scriptstr == 0) return GL__M(##ScriptOff,1); GL__M(##ScriptOff, 2); glk_stream_close(gg_scriptstr, 0); ! stream_close gg_scriptstr = 0; ]; [ ANNOUNCE_STORY_FILE_VERSION_R ix; if (actor ~= player) rfalse; Banner(); print "Identification number: "; for (ix=6: ix <= UUID_ARRAY->0: ix++) print (char) UUID_ARRAY->ix; print "^"; @gestalt 1 0 ix; print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; @gestalt 0 0 ix; print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; print "Library serial number ", (string) LibSerial, "^"; #Ifdef LanguageVersion; print (string) LanguageVersion, "^"; #Endif; ! LanguageVersion ShowExtensionVersions(); say__p = 1; ]; [ DESCEND_TO_SPECIFIC_ACTION_R; indirect(#actions_table-->(action+1)); rtrue; ]; #Endif; #Ifdef TARGET_ZCODE; Global top_object; ! largest valid number of any tree object Global xcommsdir; ! true if command recording is on Global transcript_mode; ! true if game scripting is on Constant INPUT_BUFFER_LEN = 120; ! Length of buffer array Array buffer -> 123; ! Buffer for parsing main line of input Array buffer2 -> 123; ! Buffers for supplementary questions Array buffer3 -> 123; ! Buffer retaining input for "again" Array parse buffer 63; ! Parse table mirroring it Array parse2 buffer 63; ! Global dict_start; Global dict_entry_size; Global dict_end; [ VM_Initialise; standard_interpreter = HDR_TERPSTANDARD-->0; transcript_mode = ((HDR_GAMEFLAGS-->0) & 1); dict_start = HDR_DICTIONARY-->0; dict_entry_size = dict_start->(dict_start->0 + 1); dict_start = dict_start + dict_start->0 + 4; dict_end = dict_start + ((dict_start - 2)-->0) * dict_entry_size; buffer->0 = INPUT_BUFFER_LEN; buffer2->0 = INPUT_BUFFER_LEN; buffer3->0 = INPUT_BUFFER_LEN; parse->0 = 15; parse2->0 = 15; top_object = #largest_object-255; #ifdef FIX_RNG; @random 10000 -> i; i = -i-2000; print "[Random number generator seed is ", i, "]^"; @random i -> i; #endif; ! FIX_RNG ]; [ ENABLE_GLULX_ACCEL_R; rfalse; ]; [ VM_Describe_Release i; print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; for (i=0 : i<6 : i++) print (char) HDR_GAMESERIAL->i; ]; [ VM_KeyChar win key; if (win) @set_window win; @read_char 1 -> key; return key; ]; [ VM_KeyDelay tenths key; @read_char 1 tenths VM_KeyDelay_Interrupt -> key; return key; ]; [ VM_KeyDelay_Interrupt; rtrue; ]; [ VM_ReadKeyboard a_buffer a_table i; read a_buffer a_table; #ifdef ECHO_COMMANDS; print "** "; for (i=2: i<=(a_buffer->1)+1: i++) print (char) a_buffer->i; print "^"; #ifnot; i=0; ! suppress compiler warning #endif; #Iftrue (#version_number == 6); @output_stream -1; @loadb a_buffer 1 -> sp; @add a_buffer 2 -> sp; @print_table sp sp; new_line; @output_stream 1; #Endif; ]; [ VM_CopyBuffer bto bfrom i; for (i=0: ii = bfrom->i; ]; [ VM_PrintToBuffer buf len a b c; @output_stream 3 buf; switch (metaclass(a)) { String: print (string) a; Routine: a(b, c); Object, Class: if (b) PrintOrRun(a, b, true); else print (name) a; } @output_stream -3; if (buf-->0 > len) print "Error: Overflow in VM_PrintToBuffer.^"; return buf-->0; ]; [ VM_Tokenise b p; b->(2 + b->1) = 0; @tokenise b p; ]; [ LTI_Insert i ch b y; ! Protect us from strict mode, as this isn't an array in quite the ! sense it expects b = buffer; ! Insert character ch into buffer at point i. ! Being careful not to let the buffer possibly overflow: y = b->1; if (y > b->0) y = b->0; ! Move the subsequent text along one character: for (y=y+2 : y>i : y--) b->y = b->(y-1); b->i = ch; ! And the text is now one character longer: if (b->1 < b->0) (b->1)++; ]; [ VM_InvalidDictionaryAddress addr; if ((UnsignedCompare(addr, dict_start) < 0) || (UnsignedCompare(addr, dict_end) >= 0) || ((addr - dict_start) % dict_entry_size ~= 0)) rtrue; rfalse; ]; [ VM_DictionaryAddressToNumber w; return (w-(HDR_DICTIONARY-->0 + 7))/9; ]; [ VM_NumberToDictionaryAddress n; return HDR_DICTIONARY-->0 + 7 + 9*n; ]; [ VM_CommandTableAddress i; return (HDR_STATICMEMORY-->0)-->i; ]; [ VM_PrintCommandWords i da j; da = HDR_DICTIONARY-->0; for (j=0 : j<(da+5)-->0 : j++) if (da->(j*9 + 14) == $ff-i) print "'", (address) VM_NumberToDictionaryAddress(j), "' "; ]; #Ifdef DEBUG; [ DebugAction a anames; if (a >= 4096) { print ""; return; } anames = #identifiers_table; anames = anames + 2*(anames-->0) + 2*48; print (string) anames-->a; ]; [ DebugAttribute a anames; if (a < 0 || a >= 48) print ""; else { anames = #identifiers_table; anames = anames + 2*(anames-->0); print (string) anames-->a; } ]; #Endif; [ VM_Seed_RNG n; if (n > 0) n = -n; @random n -> n; ]; [ VM_AllocateMemory amount; return 0; ]; [ VM_FreeMemory address; ]; [ VM_Picture resource_ID; #IFTRUE #version_number == 6; ! Z-machine version 6 @draw_picture resource_ID; #ENDIF; ]; [ VM_SoundEffect resource_ID; #IFTRUE #version_number == 6; ! Z-machine version 6 @sound_effect resource_ID; #ENDIF; ]; [ VM_Style sty; switch (sty) { NORMAL_VMSTY, NOTE_VMSTY: style roman; HEADER_VMSTY, SUBHEADER_VMSTY, ALERT_VMSTY: style bold; } ]; [ VM_UpperToLowerCase c; switch (c) { 'A' to 'Z': c = c + 32; 202, 204, 212, 214, 221: c--; 217, 218: c = c - 2; 158 to 160, 167 to 169, 208 to 210: c = c - 3; 186 to 190, 196 to 200: c = c - 5 ; 175 to 180: c = c - 6; } return c; ]; [ VM_LowerToUpperCase c; switch (c) { 'a' to 'z': c = c - 32; 201, 203, 211, 213, 220: c++; 215, 216: c = c + 2; 155 to 157, 164 to 166, 205 to 207: c = c + 3; 181 to 185, 191 to 195: c = c + 5 ; 169 to 174: c = c + 6; } return c; ]; [ VM_ClearScreen window; switch (window) { WIN_ALL: @erase_window -1; statuswin_cursize = 0; WIN_STATUS: @erase_window 1; WIN_MAIN: @erase_window 0; } ]; #Iftrue (#version_number == 6); [ VM_ScreenWidth width charw; @get_wind_prop 1 3 -> width; @get_wind_prop 1 13 -> charw; charw = charw & $FF; return (width+charw-1) / charw; ]; #Ifnot; [ VM_ScreenWidth; return (HDR_SCREENWCHARS->0); ]; #Endif; [ VM_ScreenHeight; return (HDR_SCREENHLINES->0); ]; [ VM_SetWindowColours f b window; if (clr_on && f && b) { if (window == 0) { ! if setting both together, set reverse clr_fgstatus = b; clr_bgstatus = f; } if (window == 1) { clr_fgstatus = f; clr_bgstatus = b; } if (window == 0 or 2) { clr_fg = f; clr_bg = b; } if (statuswin_current) @set_colour clr_fgstatus clr_bgstatus; else @set_colour clr_fg clr_bg; } ]; [ VM_RestoreWindowColours; ! compare I6 library patch L61007 if (clr_on) { ! check colour has been used VM_SetWindowColours(clr_fg, clr_bg, 2); ! make sure both sets of variables are restored VM_SetWindowColours(clr_fgstatus, clr_bgstatus, 1, true); VM_ClearScreen(); } #Iftrue (#version_number == 6); ! request screen update (0-->8) = (0-->8) | $$00000100; #Endif; ]; [ VM_MainWindow; if (statuswin_current) { if (clr_on && clr_bgstatus > 1) @set_colour clr_fg clr_bg; else style roman; @set_window 0; } statuswin_current = false; ]; [ VM_MoveCursorInStatusLine line column; ! 1-based position on text grid if (~~statuswin_current) { @set_window 1; if (clr_on && clr_bgstatus > 1) @set_colour clr_fgstatus clr_bgstatus; else style reverse; } if (line == 0) { line = 1; column = 1; } #Iftrue (#version_number == 6); Z6_MoveCursor(line, column); #Ifnot; @set_cursor line column; #Endif; statuswin_current = true; ]; #Iftrue (#version_number == 6); [ Z6_MoveCursor line column charw charh; ! 1-based position on text grid @get_wind_prop 1 13 -> charw; ! font size @log_shift charw $FFF8 -> charh; charw = charw / $100; line = 1 + charh*(line-1); column = 1 + charw*(column-1); @set_cursor line column; ]; #Endif; #Iftrue (#version_number == 6); [ VM_StatusLineHeight height wx wy x y charh; ! Split the window. Standard 1.0 interpreters should keep the window 0 ! cursor in the same absolute position, but older interpreters, ! including Infocom's don't - they keep the window 0 cursor in the ! same position relative to its origin. We therefore compensate ! manually. @get_wind_prop 0 0 -> wy; @get_wind_prop 0 1 -> wx; @get_wind_prop 0 13 -> charh; @log_shift charh $FFF8 -> charh; @get_wind_prop 0 4 -> y; @get_wind_prop 0 5 -> x; height = height * charh; @split_window height; y = y - height + wy - 1; if (y < 1) y = 1; x = x + wx - 1; @set_cursor y x 0; statuswin_cursize = height; ]; #Ifnot; [ VM_StatusLineHeight height; if (statuswin_cursize ~= height) @split_window height; statuswin_cursize = height; ]; #Endif; #Iftrue (#version_number == 6); [ Z6_DrawStatusLine width x charw scw; (0-->8) = (0-->8) &~ $$00000100; @push say__p; @push say__pc; BeginActivity(CONSTRUCTING_STATUS_LINE_ACT); VM_StatusLineHeight(statuswin_size); ! Now clear the window. This isn't totally trivial. Our approach is to select the ! fixed space font, measure its width, and print an appropriate ! number of spaces. We round up if the screen isn't a whole number ! of characters wide, and rely on window 1 being set to clip by default. VM_MoveCursorInStatusLine(1, 1); @set_font 4 -> x; width = VM_ScreenWidth(); spaces width; ClearParagraphing(); if (ForActivity(CONSTRUCTING_STATUS_LINE_ACT) == false) { ! Back to standard font for the display. We use output_stream 3 to ! measure the space required, the aim being to get 50 characters ! worth of space for the location name. VM_MoveCursorInStatusLine(1, 2); @set_font 1 -> x; switch (metaclass(left_hand_status_line)) { String: print (string) left_hand_status_line; Routine: left_hand_status_line(); } @get_wind_prop 1 3 -> width; @get_wind_prop 1 13 -> charw; charw = charw & $FF; @output_stream 3 StorageForShortName; print (PrintText) right_hand_status_line; @output_stream -3; scw = HDR_PIXELSTO3-->0 + charw; x = 1+width-scw; @set_cursor 1 x; print (PrintText) right_hand_status_line; } ! Reselect roman, as Infocom's interpreters go funny if reverse is selected twice. VM_MainWindow(); ClearParagraphing(); EndActivity(CONSTRUCTING_STATUS_LINE_ACT); @pull say__pc; @pull say__p; ]; #Endif; [ VM_Undo result_code; @restore_undo result_code; return result_code; ]; [ VM_Save_Undo result_code; @save_undo result_code; return result_code; ]; [ QUIT_THE_GAME_R; if (actor ~= player) rfalse; GL__M(##Quit,2); if (YesOrNo()~=0) quit; ]; [ RESTART_THE_GAME_R; if (actor ~= player) rfalse; GL__M(##Restart,1); if (YesOrNo()~=0) { @restart; GL__M(##Restart,2); } ]; [ RESTORE_THE_GAME_R; if (actor ~= player) rfalse; restore Rmaybe; return GL__M(##Restore,1); .RMaybe; GL__M(##Restore,2); ]; [ SAVE_THE_GAME_R flag; if (actor ~= player) rfalse; #IFV5; @save -> flag; switch (flag) { 0: GL__M(##Save,1); 1: GL__M(##Save,2); 2: GL__M(##Restore,2); } #IFNOT; save Smaybe; return GL__M(##Save,1); .SMaybe; GL__M(##Save,2); #ENDIF; ]; [ VERIFY_THE_STORY_FILE_R; if (actor ~= player) rfalse; @verify ?Vmaybe; jump Vwrong; .Vmaybe; return GL__M(##Verify,1); .Vwrong; GL__M(##Verify,2); ]; [ SWITCH_TRANSCRIPT_ON_R; if (actor ~= player) rfalse; transcript_mode = ((0-->8) & 1); if (transcript_mode) return GL__M(##ScriptOn,1); @output_stream 2; if (((0-->8) & 1) == 0) return GL__M(##ScriptOn,3); GL__M(##ScriptOn,2); VersionSub(); transcript_mode = true; ]; [ SWITCH_TRANSCRIPT_OFF_R; if (actor ~= player) rfalse; transcript_mode = ((0-->8) & 1); if (transcript_mode == false) return GL__M(##ScriptOff,1); GL__M(##ScriptOff,2); @output_stream -2; if ((0-->8) & 1) return GL__M(##ScriptOff,3); transcript_mode = false; ]; [ ANNOUNCE_STORY_FILE_VERSION_R ix; if (actor ~= player) rfalse; Banner(); print "Identification number: "; for (ix=6: ix <= UUID_ARRAY->0: ix++) print (char) UUID_ARRAY->ix; print "^"; ix = 0; ! shut up compiler warning if (standard_interpreter > 0) { print "Standard interpreter ", standard_interpreter/256, ".", standard_interpreter%256, " (", HDR_TERPNUMBER->0; #Iftrue (#version_number == 6); print (char) '.', HDR_TERPVERSION->0; #Ifnot; print (char) HDR_TERPVERSION->0; #Endif; print ") / "; } else { print "Interpreter ", HDR_TERPNUMBER->0, " Version "; #Iftrue (#version_number == 6); print HDR_TERPVERSION->0; #Ifnot; print (char) HDR_TERPVERSION->0; #Endif; print " / "; } print "Library serial number ", (string) LibSerial, "^"; #Ifdef LanguageVersion; print (string) LanguageVersion, "^"; #Endif; ! LanguageVersion #ifdef ShowExtensionVersions; ShowExtensionVersions(); #endif; say__p = 1; ]; [ DESCEND_TO_SPECIFIC_ACTION_R; indirect(#actions_table-->action); rtrue; ]; [ OhLookItsReal; ]; [ OhLookItsRoom; ]; [ OhLookItsThing; ]; [ OC__Cl obj cla j a n objflag; ! if (cla > 4) OhLookItsReal(); ! if (cla == K1_room) OhLookItsRoom(); ! if (cla == K2_thing) OhLookItsThing(); @jl obj 1 ?NotObj; @jg obj max_z_object ?NotObj; @inc objflag; @je cla K1_room ?~NotRoom; @test_attr obj mark_as_room ?rtrue; @rfalse; .NotRoom; @je cla K2_thing ?~NotObj; @test_attr obj mark_as_thing ?rtrue; @rfalse; .NotObj; @je cla Object Class ?ObjOrClass; @je cla Routine String ?RoutOrStr; @jin cla 1 ?~Mistake; @jz objflag ?rfalse; @get_prop_addr obj 2 -> a; @jz a ?rfalse; @get_prop_len a -> n; @div n 2 -> n; .Loop; @loadw a j -> sp; @je sp cla ?rtrue; @inc j; @jl j n ?Loop; @rfalse; .ObjOrClass; @jz objflag ?rfalse; @je cla Object ?JustObj; ! So now cla is Class @jg obj String ?~rtrue; @jin obj Class ?rtrue; @rfalse; .JustObj; ! So now cla is Object @jg obj String ?~rfalse; @jin obj Class ?rfalse; @rtrue; .RoutOrStr; @jz objflag ?~rfalse; @call_2s Z__Region obj -> sp; @inc sp; @je sp cla ?rtrue; @rfalse; .Mistake; RT__Err("apply 'ofclass' for", cla, -1); rfalse; ]; [ Unsigned__Compare x y u v; @je x y ?rfalse; ! i.e., return 0 @jl x 0 ?XNegative; ! So here x >= 0 and x ~= y @jl y 0 ?XPosYNeg; ! Here x >=0, y >= 0, x ~= y @jg x y ?rtrue; ! i.e., return 1 @ret -1; .XPosYNeg; ! Here x >= 0, y < 0, x ~= y @ret -1; .XNegative; @jl y 0 ?~rtrue; ! if x < 0, y >= 0, return 1 ! Here x < 0, y < 0, x ~= y @jg x y ?rtrue; @ret -1; ]; [ RT__ChLDW base offset; @loadw base offset -> sp; @ret sp; ]; #Endif; Class CompassDirection with capacity 0, article "the", description [; L__M(##Look, 7, self); ], has scenery; Object Compass "compass" has concealed; Constant AGAIN1__WD = 'again'; Constant AGAIN2__WD = 'g//'; Constant AGAIN3__WD = 'again'; Constant OOPS1__WD = 'oops'; Constant OOPS2__WD = 'o//'; Constant OOPS3__WD = 'oops'; Constant UNDO1__WD = 'undo'; Constant UNDO2__WD = 'undo'; Constant UNDO3__WD = 'undo'; Constant ALL1__WD = 'all'; Constant ALL2__WD = 'each'; Constant ALL3__WD = 'every'; Constant ALL4__WD = 'everything'; Constant ALL5__WD = 'both'; Constant AND1__WD = 'and'; Constant AND2__WD = 'and'; Constant AND3__WD = 'and'; Constant BUT1__WD = 'but'; Constant BUT2__WD = 'except'; Constant BUT3__WD = 'but'; Constant ME1__WD = 'me'; Constant ME2__WD = 'myself'; Constant ME3__WD = 'self'; Constant OF1__WD = 'of'; Constant OF2__WD = 'of'; Constant OF3__WD = 'of'; Constant OF4__WD = 'of'; Constant OTHER1__WD = 'another'; Constant OTHER2__WD = 'other'; Constant OTHER3__WD = 'other'; Constant THEN1__WD = 'then'; Constant THEN2__WD = 'then'; Constant THEN3__WD = 'then'; Constant NO1__WD = 'n//'; Constant NO2__WD = 'no'; Constant NO3__WD = 'no'; Constant YES1__WD = 'y//'; Constant YES2__WD = 'yes'; Constant YES3__WD = 'yes'; Constant AMUSING__WD = 'amusing'; Constant FULLSCORE1__WD = 'fullscore'; Constant FULLSCORE2__WD = 'full'; Constant QUIT1__WD = 'q//'; Constant QUIT2__WD = 'quit'; Constant RESTART__WD = 'restart'; Constant RESTORE__WD = 'restore'; Array LanguagePronouns table ! word possible GNAs connected ! to follow: to: ! a i ! s p s p ! mfnmfnmfnmfn 'it' $$001000111000 NULL 'him' $$100000000000 NULL 'her' $$010000000000 NULL 'them' $$000111000111 NULL; Array LanguageDescriptors table ! word possible GNAs descriptor connected ! to follow: type: to: ! a i ! s p s p ! mfnmfnmfnmfn 'my' $$111111111111 POSSESS_PK 0 'this' $$111111111111 POSSESS_PK 0 'these' $$000111000111 POSSESS_PK 0 'that' $$111111111111 POSSESS_PK 1 'those' $$000111000111 POSSESS_PK 1 'his' $$111111111111 POSSESS_PK 'him' 'her' $$111111111111 POSSESS_PK 'her' 'their' $$111111111111 POSSESS_PK 'them' 'its' $$111111111111 POSSESS_PK 'it' 'the' $$111111111111 DEFART_PK NULL 'a//' $$111000111000 INDEFART_PK NULL 'an' $$111000111000 INDEFART_PK NULL 'some' $$000111000111 INDEFART_PK NULL 'lit' $$111111111111 light NULL 'lighted' $$111111111111 light NULL 'unlit' $$111111111111 (-light) NULL; Array LanguageNumbers table 'one' 1 'two' 2 'three' 3 'four' 4 'five' 5 'six' 6 'seven' 7 'eight' 8 'nine' 9 'ten' 10 'eleven' 11 'twelve' 12 'thirteen' 13 'fourteen' 14 'fifteen' 15 'sixteen' 16 'seventeen' 17 'eighteen' 18 'nineteen' 19 'twenty' 20 'twenty-one' 21 'twenty-two' 22 'twenty-three' 23 'twenty-four' 24 'twenty-five' 25 'twenty-six' 26 'twenty-seven' 27 'twenty-eight' 28 'twenty-nine' 29 'thirty' 30 ; [ LanguageNumber n f; if (n == 0) { print "zero"; rfalse; } if (n < 0) { print "minus "; n = -n; } if (n >= 1000) { print (LanguageNumber) n/1000, " thousand"; n = n%1000; f = 1; } if (n >= 100) { if (f == 1) print ", "; print (LanguageNumber) n/100, " hundred"; n = n%100; f = 1; } if (n == 0) rfalse; #Ifdef DIALECT_US; if (f == 1) print " "; #Ifnot; if (f == 1) print " and "; #Endif; switch (n) { 1: print "one"; 2: print "two"; 3: print "three"; 4: print "four"; 5: print "five"; 6: print "six"; 7: print "seven"; 8: print "eight"; 9: print "nine"; 10: print "ten"; 11: print "eleven"; 12: print "twelve"; 13: print "thirteen"; 14: print "fourteen"; 15: print "fifteen"; 16: print "sixteen"; 17: print "seventeen"; 18: print "eighteen"; 19: print "nineteen"; 20 to 99: switch (n/10) { 2: print "twenty"; 3: print "thirty"; 4: print "forty"; 5: print "fifty"; 6: print "sixty"; 7: print "seventy"; 8: print "eighty"; 9: print "ninety"; } if (n%10 ~= 0) print "-", (LanguageNumber) n%10; } ]; [ LanguageTimeOfDay hours mins i; i = hours%12; if (i == 0) i = 12; if (i < 10) print " "; print i, ":", mins/10, mins%10; if ((hours/12) > 0) print " pm"; else print " am"; ]; [ LanguageDirection d; print (name) d; ]; [ LanguageToInformese; ]; Constant LanguageAnimateGender = male; Constant LanguageInanimateGender = neuter; Constant LanguageContractionForms = 2; ! English has two: ! 0 = starting with a consonant ! 1 = starting with a vowel [ LanguageContraction text; if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u' or 'A' or 'E' or 'I' or 'O' or 'U') return 1; return 0; ]; Array LanguageArticles --> ! Contraction form 0: Contraction form 1: ! Cdef Def Indef Cdef Def Indef "The " "the " "a " "The " "the " "an " ! Articles 0 "The " "the " "some " "The " "the " "some "; ! Articles 1 ! a i ! s p s p ! m f n m f n m f n m f n Array LanguageGNAsToArticles --> 0 0 0 1 1 1 0 0 0 1 1 1; [ LanguageVerb i; switch (i) { 'i//','inv','inventory': print "take inventory"; 'l//': print "look"; 'x//': print "examine"; 'z//': print "wait"; default: rfalse; } rtrue; ]; [ LanguageVerbLikesAdverb w; if (w == 'look' or 'go' or 'push' or 'walk') rtrue; rfalse; ]; [ LanguageVerbMayBeName w; if (w == 'long' or 'short' or 'normal' or 'brief' or 'full' or 'verbose') rtrue; rfalse; ]; Constant NKEY__TX = "N = next subject"; Constant PKEY__TX = "P = previous"; Constant QKEY1__TX = " Q = resume game"; Constant QKEY2__TX = "Q = previous menu"; Constant RKEY__TX = "RETURN = read subject"; Constant NKEY1__KY = 'N'; Constant NKEY2__KY = 'n'; Constant PKEY1__KY = 'P'; Constant PKEY2__KY = 'p'; Constant QKEY1__KY = 'Q'; Constant QKEY2__KY = 'q'; Constant SCORE__TX = "Score: "; Constant MOVES__TX = "Moves: "; Constant TIME__TX = "Time: "; Global CANTGO__TX = "You can't go that way."; Global FORMER__TX = "your former self"; Global YOURSELF__TX = "yourself"; Constant YOU__TX = "You"; Constant DARKNESS__TX = "Darkness"; Constant THOSET__TX = "those things"; Constant THAT__TX = "that"; Constant OR__TX = " or "; Constant NOTHING__TX = "nothing"; Global IS__TX = " is"; Global ARE__TX = " are"; Global IS2__TX = "is "; Global ARE2__TX = "are "; Global IS3__TX = "is"; Global ARE3__TX = "are"; Constant AND__TX = " and "; #ifdef SERIAL_COMMA; Constant LISTAND__TX = ", and "; Constant LISTAND2__TX = " and "; #ifnot; Constant LISTAND__TX = " and "; Constant LISTAND2__TX = " and "; #endif; ! SERIAL_COMMA Constant WHOM__TX = "whom "; Constant WHICH__TX = "which "; Constant COMMA__TX = ", "; [ ThatorThose obj; ! Used in the accusative if (obj == player) { print "you"; return; } if (obj has pluralname) { print "those"; return; } if (obj has animate) { if (obj has female) { print "her"; return; } else if (obj hasnt neuter) { print "him"; return; } } print "that"; ]; [ ItorThem obj; if (obj == player) { print "yourself"; return; } if (obj has pluralname) { print "them"; return; } if (obj has animate) { if (obj has female) { print "her"; return; } else if (obj hasnt neuter) { print "him"; return; } } print "it"; ]; [ IsorAre obj; if (obj has pluralname || obj == player) print "are"; else print "is"; ]; [ HasorHave obj; if (obj has pluralname || obj == player) print "have"; else print "has"; ]; [ CThatorThose obj; ! Used in the nominative if (obj == player) { print "You"; return; } if (obj has pluralname) { print "Those"; return; } if (obj has animate) { if (obj has female) { print "She"; return; } else if (obj hasnt neuter) { print "He"; return; } } print "That"; ]; [ CTheyreorThats obj; if (obj == player) { print "You're"; return; } if (obj has pluralname) { print "They're"; return; } if (obj has animate) { if (obj has female) { print "She's"; return; } else if (obj hasnt neuter) { print "He's"; return; } } print "That's"; ]; [ HisHerTheir o; if (o has pluralname) { print "their"; return; } if (o has female) { print "her"; return; } if (o has neuter) { print "its"; return; } print "his"; ]; [ HimHerItself o; if (o has pluralname) { print "theirselves"; return; } if (o has female) { print "herself"; return; } if (o has neuter) { print "itself"; return; } print "himself"; ]; [ LanguageLM n x1 x2; say__p = 1; Answer,Ask: "There is no reply."; ! Ask: see Answer Attack: "Violence isn't the answer to this one."; Burn: "This dangerous act would achieve little."; Buy: "Nothing is on sale."; Climb: "I don't think much is to be achieved by that."; Close: switch (n) { 1: print_ret (ctheyreorthats) x1, " not something you can close."; 2: print_ret (ctheyreorthats) x1, " already closed."; 3: "You close ", (the) x1, "."; 4: print (The) actor, " closes ", (the) x1, ".^"; 5: print (The) x1, " close"; if (x1 hasnt pluralname) print "s"; print ".^"; } Consult: switch (n) { 1: "You discover nothing of interest in ", (the) x1, "."; 2: print (The) actor, " looks at ", (the) x1, ".^"; } Cut: "Cutting ", (thatorthose) x1, " up would achieve little."; Disrobe: switch (n) { 1: "You're not wearing ", (thatorthose) x1, "."; 2: "You take off ", (the) x1, "."; 3: print (The) actor, " takes off ", (the) x1, ".^"; } Drink: "There's nothing suitable to drink here."; Drop: switch (n) { 1: if (x1 has pluralname) print (The) x1, " are "; else print (The) x1, " is "; "already here."; 2: "You haven't got ", (thatorthose) x1, "."; 3: print "(first taking ", (the) x1, " off)^"; say__p = 0; return; 4: "Dropped."; 5: "There is no more room on ", (the) x1, "."; 6: "There is no more room in ", (the) x1, "."; 7: print (The) actor, " puts down ", (the) x1, ".^"; } Eat: switch (n) { 1: print_ret (ctheyreorthats) x1, " plainly inedible."; 2: "You eat ", (the) x1, ". Not bad."; 3: print (The) actor, " eats ", (the) x1, ".^"; } Enter: switch (n) { 1: print "But you're already "; if (x1 has supporter) print "on "; else print "in "; print_ret (the) x1, "."; 2: if (x1 has pluralname) print "They're"; else print "That's"; print " not something you can "; switch (verb_word) { 'stand': "stand on."; 'sit': "sit down on."; 'lie': "lie down on."; default: "enter."; } 3: "You can't get into the closed ", (name) x1, "."; 4: "You can only get into something free-standing."; 5: print "You get "; if (x1 has supporter) print "onto "; else print "into "; print_ret (the) x1, "."; 6: print "(getting "; if (x1 has supporter) print "off "; else print "out of "; print (the) x1; print ")^"; say__p = 0; return; 7: ! say__p = 0; if (x1 has supporter) "(getting onto ", (the) x1, ")"; if (x1 has container) "(getting into ", (the) x1, ")"; "(entering ", (the) x1, ")"; 8: print (The) actor, " gets into ", (the) x1, ".^"; 9: print (The) actor, " gets onto ", (the) x1, ".^"; } Examine: switch (n) { 1: "Darkness, noun. An absence of light to see by."; 2: "You see nothing special about ", (the) x1, "."; 3: print (The) x1, " ", (isorare) x1, " currently switched "; if (x1 has on) "on."; else "off."; 4: print (The) actor, " looks closely at ", (the) x1, ".^"; 5: "You see nothing unexpected in that direction."; } Exit: switch (n) { 1: "But you aren't in anything at the moment."; 2: "You can't get out of the closed ", (name) x1, "."; 3: print "You get "; if (x1 has supporter) print "off "; else print "out of "; print_ret (the) x1, "."; 4: print "But you aren't "; if (x1 has supporter) print "on "; else print "in "; print_ret (the) x1, "."; 5: print (The) actor, " gets off ", (the) x1, ".^"; 6: print (The) actor, " gets out of ", (the) x1, ".^"; } GetOff: "But you aren't on ", (the) x1, " at the moment."; Give: switch (n) { 1: "You aren't holding ", (the) x1, "."; 2: "You juggle ", (the) x1, " for a while, but don't achieve much."; 3: print (The) x1; if (x1 has pluralname) print " don't"; else print " doesn't"; " seem interested."; 4: print (The) x1; if (x1 has pluralname) print " aren't"; else print " isn't"; " able to receive things."; 5: "You give ", (the) x1, " to ", (the) second, "."; 6: print (The) actor, " gives ", (the) x1, " to you.^"; 7: print (The) actor, " gives ", (the) x1, " to ", (the) second, ".^"; } Go: switch (n) { 1: print "You'll have to get "; if (x1 has supporter) print "off "; else print "out of "; print_ret (the) x1, " first."; 2: print_ret (string) CANTGO__TX; ! "You can't go that way." 3: "You are unable to climb ", (the) x1, "."; 4: "You are unable to descend by ", (the) x1, "."; 5: "You can't, since ", (the) x1, " ", (isorare) x1, " in the way."; 6: print "You can't, since ", (the) x1; if (x1 has pluralname) " lead nowhere."; else " leads nowhere."; 7: "You'll have to say which compass direction to go in."; 8: print (The) actor, " goes up"; 9: print (The) actor, " goes down"; 10: print (The) actor, " goes ", (name) x1; 11: print (The) actor, " arrives from above"; 12: print (The) actor, " arrives from below"; 13: print (The) actor, " arrives from the ", (name) x1; 14: print (The) actor, " arrives"; 15: print (The) actor, " arrives at ", (the) x1, " from above"; 16: print (The) actor, " arrives at ", (the) x1, " from below"; 17: print (The) actor, " arrives at ", (the) x1, " from the ", (name) x2; 18: print (The) actor, " goes through ", (the) x1; 19: print (The) actor, " arrives from ", (the) x1; 20: print "on ", (the) x1; 21: print "in ", (the) x1; 22: print ", pushing ", (the) x1, " in front, and you along too"; 23: print ", pushing ", (the) x1, " in front"; 24: print ", pushing ", (the) x1, " away"; 25: print ", pushing ", (the) x1, " in"; 26: print ", taking you along"; } Insert: switch (n) { 1: "You need to be holding ", (the) x1, " before you can put ", (itorthem) x1, " into something else."; 2: print_ret (Cthatorthose) x1, " can't contain things."; 3: print_ret (The) x1, " ", (isorare) x1, " closed."; 4: "You'll need to take ", (itorthem) x1, " off first."; 5: "You can't put something inside itself."; 6: print "(first taking ", (itorthem) x1, " off)^"; say__p = 0; return; 7: "There is no more room in ", (the) x1, "."; 8: "Done."; 9: "You put ", (the) x1, " into ", (the) second, "."; 10: print (The) actor, " puts ", (the) x1, " into ", (the) second, ".^"; } Inv: switch (n) { 1: "You are carrying nothing."; 2: print "You are carrying"; 3: print ":^"; 4: print ".^"; 5: print (The) x1, " looks through ", (HisHerTheir) x1, " possessions.^"; } Jump: "You jump on the spot, fruitlessly."; Kiss: "Keep your mind on the game."; Listen: "You hear nothing unexpected."; ListMiscellany: switch (n) { 1: print " (providing light)"; 2: print " (closed)"; 4: print " (empty)"; 6: print " (closed and empty)"; 3: print " (closed and providing light)"; 5: print " (empty and providing light)"; 7: print " (closed, empty and providing light)"; 8: print " (providing light and being worn"; 9: print " (providing light"; 10: print " (being worn"; 11: print " ("; 12: print "open"; 13: print "open but empty"; 14: print "closed"; 15: print "closed and locked"; 16: print " and empty"; 17: print " (empty)"; 18: print " containing "; 19: print " (on "; 20: print ", on top of "; 21: print " (in "; 22: print ", inside "; } LMode1: " is now in its normal ~brief~ printing mode, which gives long descriptions of places never before visited and short descriptions otherwise."; LMode2: " is now in its ~verbose~ mode, which always gives long descriptions of locations (even if you've been there before)."; LMode3: " is now in its ~superbrief~ mode, which always gives short descriptions of locations (even if you haven't been there before)."; Lock: switch (n) { 1: if (x1 has pluralname) print "They don't "; else print "That doesn't "; "seem to be something you can lock."; 2: print_ret (ctheyreorthats) x1, " locked at the moment."; 3: "First you'll have to close ", (the) x1, "."; 4: if (x1 has pluralname) print "Those don't "; else print "That doesn't "; "seem to fit the lock."; 5: "You lock ", (the) x1, "."; 6: print (The) actor, " locks ", (the) x1, ".^"; } Look: switch (n) { 1: print " (on ", (the) x1, ")"; 2: print " (in ", (the) x1, ")"; 3: print " (as ", (object) x1, ")"; 4: print "On ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 5,6: if (x1 ~= location) { if (x1 has supporter) print "On "; else print "In "; print (the) x1, " you"; } else print "You"; print " can "; if (n == 5) print "also "; print "see "; WriteListFrom(child(x1), ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+WORKFLAG_BIT); if (x1 ~= location) "."; else " here."; 7: "You see nothing unexpected in that direction."; 8: if (x1 has supporter) print " (on "; else print " (in "; print (the) x1, ")"; 9: print (The) actor, " looks around.^"; } LookUnder: switch (n) { 1: "But it's dark."; 2: "You find nothing of interest."; 3: print (The) actor, " looks under ", (the) x1, ".^"; } Mild: "Quite."; Miscellany: switch (n) { 1: "(considering the first sixteen objects only)^"; 2: "Nothing to do!"; 3: print " You have died "; 4: print " You have won "; 5: print "^Would you like to RESTART, RESTORE a saved game"; #Ifdef DEATH_MENTION_UNDO; print ", UNDO your last move"; #Endif; #ifdef SERIAL_COMMA; print ","; #endif; " or QUIT?"; 6: "[Your interpreter does not provide ~undo~. Sorry!]"; #Ifdef TARGET_ZCODE; 7: "~Undo~ failed. [Not all interpreters provide it.]"; #Ifnot; ! TARGET_GLULX 7: "[You cannot ~undo~ any further.]"; #Endif; ! TARGET_ 8: "Please give one of the answers above."; 9: "It is now pitch dark in here!"; 10: "I beg your pardon?"; 11: "[You can't ~undo~ what hasn't been done!]"; 12: "[Can't ~undo~ twice in succession. Sorry!]"; 13: "[Previous turn undone.]"; 14: "Sorry, that can't be corrected."; 15: "Think nothing of it."; 16: "~Oops~ can only correct a single word."; 17: "It is pitch dark, and you can't see a thing."; 18: print "yourself"; 19: "As good-looking as ever."; 20: "To repeat a command like ~frog, jump~, just say ~again~, not ~frog, again~."; 21: "You can hardly repeat that."; 22: "You can't begin with a comma."; 23: "You seem to want to talk to someone, but I can't see whom."; 24: "You can't talk to ", (the) x1, "."; 25: "To talk to someone, try ~someone, hello~ or some such."; 26: "(first taking ", (the) x1, ")"; 27: "I didn't understand that sentence."; 28: print "I only understood you as far as wanting to "; 29: "I didn't understand that number."; 30: "You can't see any such thing."; 31: "You seem to have said too little!"; 32: "You aren't holding that!"; 33: "You can't use multiple objects with that verb."; 34: "You can only use multiple objects once on a line."; 35: "I'm not sure what ~", (address) pronoun_word, "~ refers to."; 36: "You excepted something not included anyway!"; 37: "You can only do that to something animate."; #Ifdef DIALECT_US; 38: "That's not a verb I recognize."; #Ifnot; 38: "That's not a verb I recognise."; #Endif; 39: "That's not something you need to refer to in the course of this game."; 40: "You can't see ~", (address) pronoun_word, "~ (", (the) pronoun_obj, ") at the moment."; 41: "I didn't understand the way that finished."; 42: if (x1 == 0) print "None"; else print "Only ", (number) x1; print " of those "; if (x1 == 1) print "is"; else print "are"; " available."; 43: "Nothing to do!"; 44: "There are none at all available!"; 45: print "Who do you mean, "; 46: print "Which do you mean, "; 47: "Sorry, you can only have one item here. Which exactly?"; 48: print "Whom do you want"; if (actor ~= player) print " ", (the) actor; print " to "; PrintCommand(); print "?^"; 49: print "What do you want"; if (actor ~= player) print " ", (the) actor; print " to "; PrintCommand(); print "?^"; 50: print "Your score has just gone "; if (x1 > 0) print "up"; else { x1 = -x1; print "down"; } print " by ", (number) x1, " point"; if (x1 > 1) print "s"; 51: "(Since something dramatic has happened, your list of commands has been cut short.)"; 52: "^Type a number from 1 to ", x1, ", 0 to redisplay or press ENTER."; 53: "^[Please press SPACE.]"; 54: "[Comment recorded.]"; 55: "[Comment NOT recorded.]"; 56: print ".^"; 57: print "?^"; 58: print (The) actor, " ", (IsOrAre) actor, " unable to do that.^"; 59: "You must supply a noun."; 60: "You may not supply a noun."; 61: "You must name an object."; 62: "You may not name an object."; 63: "You must name a second object."; 64: "You may not name a second object."; 65: "You must supply a second noun."; 66: "You may not supply a second noun."; 67: "You must name something more substantial."; 68: print "(", (The) actor, " first taking ", (the) x1, ")^"; 69: "(first taking ", (the) x1, ")"; 70: "The use of UNDO is forbidden in this game."; 71: print (string) DARKNESS__TX; 72: print (The) x1; if (x1 has pluralname) print " have"; else print " has"; " better things to do."; 73: "That noun did not make sense in this context."; 74: print "[That command asks to do something outside of play, so it can only make sense from you to me. ", (The) x1, " cannot be asked to do this.]^"; } No,Yes: "That was a rhetorical question."; NotifyOff: "Score notification off."; NotifyOn: "Score notification on."; Open: switch (n) { 1: print_ret (ctheyreorthats) x1, " not something you can open."; 2: if (x1 has pluralname) print "They seem "; else print "It seems "; "to be locked."; 3: print_ret (ctheyreorthats) x1, " already open."; 4: print "You open ", (the) x1, ", revealing "; if (WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT) == 0) "nothing."; "."; 5: "You open ", (the) x1, "."; 6: print (The) actor, " opens ", (the) x1, ".^"; 7: print (The) x1, " open"; if (x1 hasnt pluralname) print "s"; print ".^"; } Pronouns: switch (n) { 1: print "At the moment, "; 2: print "means "; 3: print "is unset"; 4: "no pronouns are known to the game."; 5: "."; } Pull,Push,Turn: switch (n) { 1: if (x1 has pluralname) print "Those are "; else print "It is "; "fixed in place."; 2: "You are unable to."; 3: "Nothing obvious happens."; 4: "That would be less than courteous."; 5: print (The) actor, " pulls ", (the) x1, ".^"; 6: print (The) actor, " pushes ", (the) x1, ".^"; 7: print (The) actor, " turns ", (the) x1, ".^"; } ! Push: see Pull PushDir: switch (n) { 1: print (The) x1, " cannot be pushed from place to place.^"; 2: "That's not a direction."; 3: "Not that way you can't."; } PutOn: switch (n) { 1: "You need to be holding ", (the) x1, " before you can put ", (itorthem) x1, " on top of something else."; 2: "You can't put something on top of itself."; 3: "Putting things on ", (the) x1, " would achieve nothing."; 4: "You lack the dexterity."; 5: print "(first taking ", (itorthem) x1, " off)^"; say__p = 0; return; 6: "There is no more room on ", (the) x1, "."; 7: "Done."; 8: "You put ", (the) x1, " on ", (the) second, "."; 9: print (The) actor, " puts ", (the) x1, " on ", (the) second, ".^"; } Quit: switch (n) { 1: print "Please answer yes or no."; 2: print "Are you sure you want to quit? "; } Remove: switch (n) { 1: if (x1 has pluralname) print "They are"; else print "It is"; " unfortunately closed."; 2: if (x1 has pluralname) print "But they aren't"; else print "But it isn't"; " there now."; 3: "Removed."; } Restart: switch (n) { 1: print "Are you sure you want to restart? "; 2: "Failed."; } Restore: switch (n) { 1: "Restore failed."; 2: "Ok."; } Rub: "You achieve nothing by this."; Save: switch (n) { 1: "Save failed."; 2: "Ok."; } Score: switch (n) { 1: if (deadflag) print "In that game you scored "; else print "You have so far scored "; print score, " out of a possible ", MAX_SCORE, ", in ", turns, " turn"; if (turns ~= 1) print "s"; return; 2: "There is no score in this story."; 3: print ", earning you the rank of "; } ScriptOff: switch (n) { 1: "Transcripting is already off."; 2: "^End of transcript."; 3: "Attempt to end transcript failed."; } ScriptOn: switch (n) { 1: "Transcripting is already on."; 2: "Start of a transcript of"; 3: "Attempt to begin transcript failed."; } Search: switch (n) { 1: "But it's dark."; 2: "There is nothing on ", (the) x1, "."; 3: print "On ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 4: "You find nothing of interest."; 5: "You can't see inside, since ", (the) x1, " ", (isorare) x1, " closed."; 6: print_ret (The) x1, " ", (isorare) x1, " empty."; 7: print "In ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 8: print (The) actor, " searches ", (the) x1, ".^"; } SetTo: "No, you can't set ", (thatorthose) x1, " to anything."; Show: switch (n) { 1: "You aren't holding ", (the) x1, "."; 2: print_ret (The) x1, " ", (isorare) x1, " unimpressed."; } Sing: "Your singing is abominable."; Sleep: "You aren't feeling especially drowsy."; Smell: "You smell nothing unexpected."; #Ifdef DIALECT_US; Sorry: "Oh, don't apologize."; #Ifnot; Sorry: "Oh, don't apologise."; #Endif; Squeeze: switch (n) { 1: "Keep your hands to yourself."; 2: "You achieve nothing by this."; 3: print (The) actor, " squeezes ", (the) x1, ".^"; } Strong: "Real adventurers do not use such language."; Swing: "There's nothing sensible to swing here."; SwitchOff: switch (n) { 1: print_ret (ctheyreorthats) x1, " not something you can switch."; 2: print_ret (ctheyreorthats) x1, " already off."; 3: "You switch ", (the) x1, " off."; 4: print (The) actor, " switches ", (the) x1, " off.^"; } SwitchOn: switch (n) { 1: print_ret (ctheyreorthats) x1, " not something you can switch."; 2: print_ret (ctheyreorthats) x1, " already on."; 3: "You switch ", (the) x1, " on."; 4: print (The) actor, " switches ", (the) x1, " on.^"; } Take: switch (n) { 1: "Taken."; 2: "You are always self-possessed."; 3: "I don't suppose ", (the) x1, " would care for that."; 4: print "You'd have to get "; if (x1 has supporter) print "off "; else print "out of "; print_ret (the) x1, " first."; 5: "You already have ", (thatorthose) x1, "."; 6: if (noun has pluralname) print "Those seem "; else print "That seems "; "to belong to ", (the) x1, "."; 7: if (noun has pluralname) print "Those seem "; else print "That seems "; "to be a part of ", (the) x1, "."; 8: print_ret (Cthatorthose) x1, " ", (isorare) x1, "n't available."; 9: print_ret (The) x1, " ", (isorare) x1, "n't open."; 10: if (x1 has pluralname) print "They're "; else print "That's "; "hardly portable."; 11: if (x1 has pluralname) print "They're "; else print "That's "; "fixed in place."; 12: "You're carrying too many things already."; 13: print "(putting ", (the) x1, " into ", (the) SACK_OBJECT, " to make room)^"; say__p = 0; return; 14: "You can't reach into ", (the) x1, "."; 15: "You cannot carry ", (the) x1, "."; 16: print (The) actor, " picks up ", (the) x1, ".^"; } Taste: "You taste nothing unexpected."; Tell: switch (n) { 1: "You talk to yourself a while."; 2: "This provokes no reaction."; } Think: "What a good idea."; ThrowAt: switch (n) { 1: "Futile."; 2: "You lack the nerve when it comes to the crucial moment."; } Tie: "You would achieve nothing by this."; Touch: switch (n) { 1: "Keep your hands to yourself!"; 2: "You feel nothing unexpected."; 3: "If you think that'll help."; 4: print (The) actor, " touches ", (himheritself) x1, ".^"; 5: print (The) actor, " touches you.^"; 6: print (The) actor, " touches ", (the) x1, ".^"; } ! Turn: see Pull. Unlock: switch (n) { 1: if (x1 has pluralname) print "They don't "; else print "That doesn't "; "seem to be something you can unlock."; 2: print_ret (ctheyreorthats) x1, " unlocked at the moment."; 3: if (x1 has pluralname) print "Those don't "; else print "That doesn't "; "seem to fit the lock."; 4: "You unlock ", (the) x1, "."; 5: print (The) actor, " unlocks ", (the) x1, ".^"; } Verify: switch (n) { 1: "The game file has verified as intact."; 2: "The game file did not verify as intact, and may be corrupt."; } Wait: switch (n) { 1: "Time passes."; 2: print (The) actor, " waits.^"; } Wake: "The dreadful truth is, this is not a dream."; WakeOther:"That seems unnecessary."; Wave: switch (n) { 1: "But you aren't holding ", (thatorthose) x1, "."; 2: "You look ridiculous waving ", (the) x1, "."; 3: print (The) actor, " waves ", (the) x1, ".^"; } WaveHands:"You wave, feeling foolish."; Wear: switch (n) { 1: "You can't wear ", (thatorthose) x1, "!"; 2: "You're not holding ", (thatorthose) x1, "!"; 3: "You're already wearing ", (thatorthose) x1, "!"; 4: "You put on ", (the) x1, "."; 5: print (The) actor, " puts on ", (the) x1, ".^"; } ! Yes: see No. ]; [ L__M act n x1 x2 rv flag; @push sw__var; sw__var = act; if (n == 0) n = 1; @push action; lm_act = act; lm_n = n; lm_o = x1; lm_o2 = x2; switch (act) { ##Miscellany: rv = ((((PHR_682())))) ; ##ListMiscellany: rv = ((((PHR_683())))) ; default: rv = ((((PHR_684())))) ; } action = sw__var; if (rv == false) rv = RunRoutines(LibraryMessages, before); @pull action; if (rv == false) LanguageLM(n, x1, x2); @pull sw__var; ]; Default LanguageCases 1; #Ifndef LibraryMessages; Object LibraryMessages; #Endif; Object thedark "(darkness object)"; [ OffersLight obj j; while (obj) { if (obj has light) rtrue; objectloop (j in obj) if (HasLightSource(j)) rtrue; if ((obj has container) && (obj hasnt open) && (obj hasnt transparent)) rfalse; if ((obj provides component_parent) && (obj.component_parent)) obj = obj.component_parent; else obj = parent(obj); } rfalse; ]; [ HasLightSource i j ad sr po; if (i == 0) rfalse; if (i has light) rtrue; if ((IsSeeThrough(i)) && (~~(HidesLightSource(i)))) objectloop (j in i) if (HasLightSource(j)) rtrue; ad = i.&add_to_scope; if (parent(i) ~= 0 && ad ~= 0) { if (metaclass(ad-->0) == Routine) { ats_hls = 0; ats_flag = 1; sr = scope_reason; po = parser_one; scope_reason = LOOPOVERSCOPE_REASON; parser_one = 0; RunRoutines(i, add_to_scope); scope_reason = sr; parser_one = po; ats_flag = 0; if (ats_hls == 1) rtrue; } else { for (j=0 : (WORDSIZE*j)j) && (HasLightSource(ad-->j) == 1)) rtrue; } } if (ComponentHasLight(i)) rtrue; rfalse; ]; [ ComponentHasLight o obj next_obj; if (o provides component_child) { obj = o.component_child; while (obj) { next_obj = obj.component_sibling; if (obj has light) rtrue; if (HasLightSource(obj)) rtrue; if ((obj provides component_child) && (ComponentHasLight(obj))) rtrue; obj = next_obj; } } rfalse; ]; [ HidesLightSource obj; if (obj == player) rfalse; if (obj has transparent or supporter) rfalse; if (obj has animate) rfalse; if (obj has container) return (obj hasnt open); return (obj hasnt enterable); ]; Global lightflag = false; [ ADJUST_LIGHT_R previous_light_condition; previous_light_condition = lightflag; lightflag = OffersLight(parent(player)); if ((previous_light_condition == false) && (lightflag == false)) { location = thedark; rfalse; } if ((previous_light_condition == false) && (lightflag == true)) { location = real_location; CarryOutActivity(PRINTING_NEWS_OF_LIGHT_ACT); rfalse; } if ((previous_light_condition == true) && (lightflag == false)) { location = thedark; DivideParagraphPoint(); BeginActivity(PRINTING_NEWS_OF_DARKNESS_ACT); if (ForActivity(PRINTING_NEWS_OF_DARKNESS_ACT) == false) L__M(##Miscellany, 9); EndActivity(PRINTING_NEWS_OF_DARKNESS_ACT); rfalse; } if ((previous_light_condition == true) && (lightflag == true)) { location = real_location; rfalse; } rfalse; ]; [ SilentlyConsiderLight; lightflag = OffersLight(parent(player)); if (lightflag) location = real_location; else location = thedark; rfalse; ]; [ IsSeeThrough obj; if ((obj has supporter) || (obj has transparent) || (obj has animate) || ((obj has container) && (obj has open))) rtrue; rfalse; ]; [ VisibilityParent o; if (o && (o has container) && (o hasnt open) && (o hasnt transparent)) return nothing; if (o) o = CoreOfParentOfCoreOf(o); return o; ]; [ FindVisibilityLevels lc up; if (location == thedark) { visibility_ceiling = thedark; visibility_levels = 0; } else { visibility_ceiling = player; while (true) { up = VisibilityParent(visibility_ceiling); if (up == 0) break; visibility_ceiling = up; lc++; } visibility_levels = lc; } ]; [ ScopeCeiling pos c; if (pos == player && location == thedark) return thedark; c = parent(pos); if (c == 0) return pos; while (VisibilityParent(c)) c = VisibilityParent(c); return c; ]; [ ObjectIsUntouchable item silent_flag flag2 p save_sp decision; if ((p ~= player) && (LocationOf(p) ~= LocationOf(player)) && ((item ofclass K4_door) || (item ofclass K7_backdrop))) { decision = false; } else { untouchable_object = item; untouchable_silence = silent_flag; touch_persona = p; if (p == actor) touch_persona = 0; save_sp = say__p; say__p = 0; if (ProcessRulebook(ACCESSIBILITY_RB, 0, true)) { if (RulebookSucceeded()) decision = false; else decision = true; } else decision = false; if (say__p == false) say__p = save_sp; } untouchable_silence = 0; return decision; ]; [ ACCESS_THROUGH_BARRIERS_R ancestor i j external p; p = touch_persona; if (p == 0) p = actor; ancestor = CommonAncestor(p, untouchable_object); if ((ancestor == 0) && (LocationOf(untouchable_object) == nothing) && ((untouchable_object ofclass K4_door or K7_backdrop) == false)) { if (touch_persona == 0) GL__M(##Take,8,untouchable_object); RulebookFails(); rtrue; } ! First, a barrier between the player and the ancestor. if (CoreOf(p) ~= ancestor) { i = parent(CoreOf(p)); j = CoreOf(i); external = false; if (j ~= i) { i = j; external = true; } while (i~=ancestor && i) { if ((external == false) && (ProcessRulebook(REACHING_OUTSIDE_RB, i)) && (RulebookFailed())) rtrue; ! Barrier i = parent(CoreOf(i)); j = CoreOf(i); external = false; if (j ~= i) { i = j; external = true; } } } ! Second, a barrier between the item and the ancestor. if (CoreOf(untouchable_object) ~= ancestor) { ! We can always get to the core of the item. i = CoreOf(untouchable_object); ! This will be on the inside of its parent, if its parent is a ! container, so there should be no exemption. i = parent(i); external = false; ! j = CoreOf(i); if (j ~= i) { i = j; external = true; } while (i~=ancestor && i) { if ((external == false) && (ProcessRulebook(REACHING_INSIDE_RB, i)) && (RulebookFailed())) rtrue; ! Barrier i = CoreOf(i); if (i == ancestor) break; i = parent(i); j = CoreOf(i); external = false; if (j ~= i) { i = j; external = true; } } } RulebookSucceeds(); ! No barrier rtrue; ]; [ CANT_REACH_INSIDE_CLOSED_R; if (parameter_object has container && parameter_object hasnt open) { if (touch_persona == 0) GL__M(##Take,9,parameter_object); RulebookFails(); rtrue; } rfalse; ]; [ CANT_REACH_OUTSIDE_CLOSED_R; if (parameter_object has container && parameter_object hasnt open) { if (touch_persona == 0) GL__M(##Take,9,parameter_object); RulebookFails(); rtrue; } rfalse; ]; [ CANT_REACH_INSIDE_ROOMS_R; if (parameter_object && parameter_object ofclass K1_room) { if (touch_persona == 0) GL__M(##Take,14,parameter_object); RulebookFails(); rtrue; } rfalse; ]; Constant REQUISITION_STACK_SIZE = 3*48; Array requisition_stack --> REQUISITION_STACK_SIZE; Global requisition_stack_pointer = 0; [ RequisitionStack len top addr; top = requisition_stack_pointer + len; if (top > REQUISITION_STACK_SIZE) return false; addr = requisition_stack + requisition_stack_pointer*WORDSIZE; ! print "Allocating ", addr, " at pointer ", requisition_stack_pointer, "^"; requisition_stack_pointer = top; return addr; ]; [ FreeStack addr; if (addr == 0) return; requisition_stack_pointer = (addr - requisition_stack)/WORDSIZE; ]; Global MarkedObjectArray = 0; Global MarkedObjectLength = 0; [ WriteListOfMarkedObjects style obj common_parent first mixed_parentage length; objectloop (obj ofclass Object && obj has workflag2) { length++; if (first == nothing) { first = obj; common_parent = parent(obj); } else { if (parent(obj) ~= common_parent) mixed_parentage = true; } } if (mixed_parentage) common_parent = nothing; if (length == 0) print (string) NOTHING__TX; else { @push MarkedObjectArray; @push MarkedObjectLength; MarkedObjectArray = RequisitionStack(length); MarkedObjectLength = length; if (MarkedObjectArray == 0) return RunTimeProblem(RTP_LISTWRITERMEMORY); if (common_parent) { ObjectTreeCoalesce(child(common_parent)); length = 0; objectloop (obj in common_parent) ! object tree order if (obj has workflag2) MarkedObjectArray-->length++ = obj; } else { length = 0; objectloop (obj ofclass Object) ! object number order if (obj has workflag2) MarkedObjectArray-->length++ = obj; } WriteListFrom(first, style, 0, false, MarkedListIterator); FreeStack(MarkedObjectArray); @pull MarkedObjectLength; @pull MarkedObjectArray; } return; ]; Constant SEEK_ITF = 0; Constant ADVANCE_ITF = 1; Constant COALESCE_ITF = 2; Constant START_ITF = 3; ! Constant DBLW; ! Uncomment this to provide debugging information at run-time [ MarkedListIterator obj depth required_lt function i; if (obj == nothing) return nothing; switch(function) { START_ITF: return MarkedObjectArray-->0; COALESCE_ITF: return MarkedListCoalesce(); SEEK_ITF, ADVANCE_ITF: for (i=0: ii == obj) { if (function == ADVANCE_ITF) i++; for (:ii; if ((required_lt) && (obj.list_together ~= required_lt)) continue; if ((c_style & WORKFLAG_BIT) && (depth==0) && (obj hasnt workflag)) continue; if ((c_style & CONCEAL_BIT) && ((obj has concealed) || (obj has scenery))) continue; return obj; } return nothing; } } return nothing; ]; [ MarkedListCoalesce o i lt l swap m; for (i=0: ii).list_together; if (lt ~= 0) { ! Find first object in list after contiguous run with this list_together value: for (i++: (ii).list_together==lt): i++) ; ! If the contiguous run extends to end of list, the list is now perfect: if (i == MarkedObjectLength) return MarkedObjectArray-->0; ! And otherwise we look to see if any future entries belong in the earlier run: for (l=i+1: ll).list_together == lt) { ! Yes, they do: so we perform a rotation to insert it before element i: swap = MarkedObjectArray-->l; for (m=l: m>i: m--) MarkedObjectArray-->m = MarkedObjectArray-->(m-1); MarkedObjectArray-->i = swap; ! And now the run is longer: i++; if (i == MarkedObjectLength) return MarkedObjectArray-->0; } i--; } } return MarkedObjectArray-->0; ]; Global list_filter_routine; [ ObjectTreeIterator obj depth required_lt function; if ((obj == nothing) || (parent(obj) == nothing)) return nothing; if (function == START_ITF) return child(parent(obj)); if (function == COALESCE_ITF) return ObjectTreeCoalesce(obj); if (function == ADVANCE_ITF) obj = sibling(obj); for (:: obj = sibling(obj)) { if (obj == nothing) return nothing; if ((required_lt) && (obj.list_together ~= required_lt)) continue; if ((c_style & WORKFLAG_BIT) && (depth==0) && (obj hasnt workflag)) continue; if (obj hasnt list_filter_permits) continue; if ((c_style & CONCEAL_BIT) && ((obj has concealed) || (obj has scenery))) continue; return obj; } ]; [ ObjectTreeCoalesce obj memb lt later; #Ifdef DBLW; print "^^Sorting out: "; DiagnoseSortList(obj); #Endif; .StartAgain; for (memb=obj: memb~=nothing: memb=sibling(memb)) { lt = memb.list_together; if (lt ~= 0) { ! Find first object in list after contiguous run with this list_together value: for (memb=sibling(memb): (memb) && (memb.list_together == lt): memb = sibling(memb)) ; ! If the contiguous run extends to end of list, the list is now perfect: if (memb == 0) return obj; ! And otherwise we look to see if any future entries belong in the earlier run: for (later=sibling(memb): later: later=sibling(later)) if (later.list_together == lt) { ! Yes, they do: so we perform a regrouping of the list and start again: obj = GroupChildren(parent(obj), list_together, lt); #Ifdef DBLW; print "^^Sorted to: "; DiagnoseSortList(obj); #Endif; jump StartAgain; } } } return obj; ]; #Ifdef DBLW; [ DiagnoseSortList obj memb; for (memb=child(obj): memb~=nothing: memb=sibling(memb)) print memb, " --> "; new_line; ]; #Endif; [ WriteListFrom first style depth noactivity iter a ol; @push c_iterator; @push c_style; @push c_depth; @push c_margin; if (iter) c_iterator = iter; else c_iterator = ObjectTreeIterator; c_style = style; c_depth = depth; c_margin = 0; if (style & EXTRAINDENT_BIT) c_margin = 1; objectloop (a ofclass Object) { give a list_filter_permits; if ((list_filter_routine) && (list_filter_routine(a) == false)) give a ~list_filter_permits; } first = c_iterator(first, depth, 0, START_ITF); if (first == nothing) { print (string) NOTHING__TX; if (style & NEWLINE_BIT ~= 0) new_line; } else { if ((noactivity) || (iter)) { WriteListR(first, c_depth, true); say__p = 1; } else { objectloop (ol provides list_together) ol.list_together = 0; CarryOutActivity(LISTING_CONTENTS_ACT, parent(first)); } } @pull c_margin; @pull c_depth; @pull c_style; @pull c_iterator; ]; [ STANDARD_CONTENTS_LISTING_R; WriteListFrom(child(parameter_object), c_style, c_depth, true); ]; #Ifdef DBLW; Global DBLW_no_classes; Global DBLW_no_objs; [ DebugPartition partition_class_sizes partition_classes first depth i k o; print "[Length of list is ", DBLW_no_objs, " with ", k, " plural.]^"; print "[Partitioned into ", DBLW_no_classes, " equivalence classes.]^"; for (i=1: i<=DBLW_no_classes : i++) { print "Class ", i, " has size ", partition_class_sizes->i, "^"; } for (k=0, o=first: kk, " represented by ", o, " with L=", o.list_together, "^"; } ]; #Endif; [ PartitionList first no_objs depth partition_classes partition_class_sizes i k l n m; for (i=0: ii = 0; n = 1; for (i=first, k=0: kk == 0) { partition_classes->k = n; partition_class_sizes->n = 1; for (l=c_iterator(i, depth, lt_value, ADVANCE_ITF), m=k+1: (l~=0) && (mm == 0) && (ListEqual(i, l))) { if (partition_class_sizes->n < 255) (partition_class_sizes->n)++; partition_classes->m = n; } } if (n < 255) n++; } n--; #Ifdef DBLW; DBLW_no_classes = n; DBLW_no_objs = no_objs; DebugPartition(partition_class_sizes, partition_classes, first, depth); DebugPartition(partition_class_sizes, partition_classes, first, depth); DebugPartition(partition_class_sizes, partition_classes, first, depth); #Endif; return n; ]; [ ListEqual o1 o2; if ((o1.plural == 0) || (o2.plural == 0)) rfalse; if (child(o1) ~= 0 && WillRecurs(o1) ~= 0) rfalse; if (child(o2) ~= 0 && WillRecurs(o2) ~= 0) rfalse; if (c_style & (FULLINV_BIT + PARTINV_BIT) ~= 0) { if ((o1 hasnt worn && o2 has worn) || (o2 hasnt worn && o1 has worn)) rfalse; if ((o1 hasnt light && o2 has light) || (o2 hasnt light && o1 has light)) rfalse; if (o1 has container) { if (o2 hasnt container) rfalse; if ((o1 has open && o2 hasnt open) || (o2 has open && o1 hasnt open)) rfalse; } else if (o2 has container) rfalse; } return Identical(o1, o2); ]; [ WillRecurs o; if (c_style & ALWAYS_BIT ~= 0) rtrue; if (c_style & RECURSE_BIT == 0) rfalse; if ((o has supporter) || ((o has container) && (o has open or transparent))) rtrue; rfalse; ]; [ NumberOfGroupsInList o no_classes depth partition_classes partition_class_sizes no_groups cl memb k current_lt lt; no_groups = no_classes; for (cl=1, memb=o, k=0: cl<=no_classes: cl++) { ! Advance to first member of class number cl while (partition_classes->k ~= cl) { k++; memb = c_iterator(memb, depth, lt_value, ADVANCE_ITF); } if (memb) { ! In case of accidents, but should always happen lt = memb.list_together; if ((lt ~= lt_value) && (lt ofclass Routine or String) && (lt == current_lt)) no_groups--; current_lt = lt; } } #Ifdef DBLW; print "[There are ", no_groups, " groups.]^"; #Endif; return no_groups; ]; [ WriteListR o depth from_start partition_classes partition_class_sizes cl memb index k2 l m no_classes q groups_to_do current_lt; if (o == nothing) return; ! An empty list: no output if (from_start) { o = c_iterator(o, depth, 0, COALESCE_ITF); ! Coalesce list and choose new start } o = c_iterator(o, depth, 0, SEEK_ITF); ! Find first entry in list from o if (o == nothing) return; ! Count index = length of list for (memb=o, index=0: memb: memb=c_iterator(memb, depth, lt_value, ADVANCE_ITF)) index++; if (c_style & ISARE_BIT ~= 0) { if (index == 1 && o hasnt pluralname) print (string) IS3__TX; else print (string) ARE3__TX; if (c_style & NEWLINE_BIT ~= 0) print ":^"; else print (char) ' '; c_style = c_style - ISARE_BIT; } partition_classes = RequisitionStack(index/WORDSIZE + 2); partition_class_sizes = RequisitionStack(index/WORDSIZE + 2); if ((partition_classes == 0) || (partition_class_sizes == 0)) return RunTimeProblem(RTP_LISTWRITERMEMORY); no_classes = PartitionList(o, index, depth, partition_classes, partition_class_sizes); groups_to_do = NumberOfGroupsInList(o, no_classes, depth, partition_classes, partition_class_sizes); for (cl=1, memb=o, index=0, current_lt=0: groups_to_do>0: cl++) { ! Set memb to first object of partition class cl while (partition_classes->index ~= cl) { index++; memb=c_iterator(memb, depth, lt_value, ADVANCE_ITF); if (memb==0) { print "*** Error in list-writer ***^"; break; } } #Ifdef DBLW; ! DebugPartition(partition_class_sizes, partition_classes, o, depth); print "^[Class ", cl, " of ", no_classes, ": first object ", memb, " (", memb.list_together, "); groups_to_do ", groups_to_do, ", current_lt=", current_lt, " listing_size=", listing_size, "]^"; #Endif; if ((memb.list_together == lt_value) || (~~(memb.list_together ofclass Routine or String))) current_lt = 0; else { if (memb.list_together == current_lt) continue; ! Otherwise this class begins a new group @push listing_size; q = memb; listing_size = 1; l = index; m = cl; while (m < no_classes && q.list_together == memb.list_together) { m++; while (partition_classes->l ~= m) { l++; q = c_iterator(q, depth, lt_value, ADVANCE_ITF); } if (q.list_together == memb.list_together) listing_size++; } if (listing_size > 1) { ! The new group contains more than one partition class WriteMultiClassGroup(cl, memb, depth, partition_class_sizes); current_lt = memb.list_together; jump GroupComplete; } current_lt = 0; @pull listing_size; } WriteSingleClassGroup(cl, memb, depth, partition_class_sizes->cl); .GroupComplete; groups_to_do--; if (c_style & ENGLISH_BIT ~= 0) { if (groups_to_do == 1) { if (cl <= 1) print (string) LISTAND2__TX; else print (string) LISTAND__TX; } if (groups_to_do > 1) print (string) COMMA__TX; } } FreeStack(partition_class_sizes); FreeStack(partition_classes); ]; ! end of WriteListR [ WriteMultiClassGroup cl memb depth partition_class_sizes q k2 l; ! Save the style, because the activity below is allowed to change it q = c_style; if (c_style & INDENT_BIT ~= 0) PrintSpaces(2*(depth+c_margin)); BeginActivity(GROUPING_TOGETHER_ACT, memb); if (ForActivity(GROUPING_TOGETHER_ACT, memb)) { c_style = c_style &~ NEWLINE_BIT; } else { if (memb.list_together ofclass String) { ! Set k2 to the number of objects covered by the group k2 = 0; for (l=0 : l(l+cl); EnglishNumber(k2); print " "; print (string) memb.list_together; if (c_style & ENGLISH_BIT ~= 0) print " ("; if (c_style & INDENT_BIT ~= 0) print ":^"; } else { inventory_stage = 1; parser_one = memb; parser_two = depth + c_margin; if (RunRoutines(memb, list_together) == 1) jump Omit__Sublist2; } c_margin++; @push lt_value; @push listing_together; @push listing_size; lt_value = memb.list_together; listing_together = memb; #Ifdef DBLW; print "^^DOWN lt_value = ", lt_value, " listing_together = ", memb, "^^"; @push DBLW_no_classes; @push DBLW_no_objs; #Endif; WriteListR(memb, depth, false); #Ifdef DBLW; print "^^UP^^"; @pull DBLW_no_objs; @pull DBLW_no_classes; #Endif; @pull listing_size; @pull listing_together; @pull lt_value; c_margin--; if (memb.list_together ofclass String) { if (q & ENGLISH_BIT ~= 0) print ")"; } else { inventory_stage = 2; parser_one = memb; parser_two = depth+c_margin; RunRoutines(memb, list_together); } .Omit__Sublist2; } EndActivity(GROUPING_TOGETHER_ACT, memb); ! If the NEWLINE_BIT has been forced by the activity, act now ! before it vanishes... if (q & NEWLINE_BIT ~= 0 && c_style & NEWLINE_BIT == 0) new_line; ! ...when the original style is restored again: c_style = q; ]; [ WriteSingleClassGroup cl memb depth size q; q = c_style; if (c_style & INDENT_BIT) PrintSpaces(2*(depth+c_margin)); if (size == 1) { if (c_style & NOARTICLE_BIT ~= 0) print (name) memb; else { if (c_style & DEFART_BIT) { if ((cl == 1) && (c_style & CFIRSTART_BIT)) print (The) memb; else print (the) memb; } else { if ((cl == 1) && (c_style & CFIRSTART_BIT)) print (CIndefArt) memb; else print (a) memb; } } } else { if (c_style & DEFART_BIT) { if ((cl == 1) && (c_style & CFIRSTART_BIT)) PrefaceByArticle(memb, 0, size); else PrefaceByArticle(memb, 1, size); } @push listing_size; listing_size = size; CarryOutActivity(PRINTING_A_NUMBER_OF_ACT, memb); @pull listing_size; } if ((size > 1) && (memb hasnt pluralname)) { give memb pluralname; WriteAfterEntry(memb, depth); give memb ~pluralname; } else WriteAfterEntry(memb, depth); c_style = q; ]; [ WriteAfterEntry o depth p recurse_flag parenth_flag eldest_child child_count combo; inventory_stage = 2; if (c_style & PARTINV_BIT) { BeginActivity(PRINTING_ROOM_DESC_DETAILS_ACT); if (ForActivity(PRINTING_ROOM_DESC_DETAILS_ACT) == false) { combo = 0; if (o has light && location hasnt light) combo=combo+1; if (o has container && o hasnt open) combo=combo+2; if ((o has container && (o has open || o has transparent)) && (child(o)==0)) combo=combo+4; if (combo) L__M(##ListMiscellany, combo, o); } EndActivity(PRINTING_ROOM_DESC_DETAILS_ACT); } ! end of PARTINV_BIT processing if (c_style & FULLINV_BIT) { if (o has light && o has worn) { L__M(##ListMiscellany, 8); parenth_flag = true; } else { if (o has light) { L__M(##ListMiscellany, 9, o); parenth_flag = true; } if (o has worn) { L__M(##ListMiscellany, 10, o); parenth_flag = true; } } if (o has container) if (o has openable) { if (parenth_flag) { #Ifdef SERIAL_COMMA; print ","; #Endif; print (string) AND__TX; } else L__M(##ListMiscellany, 11, o); if (o has open) if (child(o)) L__M(##ListMiscellany, 12, o); else L__M(##ListMiscellany, 13, o); else if (o has lockable && o has locked) L__M(##ListMiscellany, 15, o); else L__M(##ListMiscellany, 14, o); parenth_flag = true; } else if (child(o)==0 && o has transparent) if (parenth_flag) L__M(##ListMiscellany, 16, o); else L__M(##ListMiscellany, 17, o); if (parenth_flag) print ")"; } ! end of FULLINV_BIT processing child_count = 0; eldest_child = nothing; objectloop (p in o) if ((c_style & CONCEAL_BIT == 0) || (p hasnt concealed && p hasnt scenery)) if (p has list_filter_permits) { child_count++; if (eldest_child == nothing) eldest_child = p; } if (child_count && (c_style & ALWAYS_BIT)) { if (c_style & ENGLISH_BIT) L__M(##ListMiscellany, 18, o); recurse_flag = true; } if (child_count && (c_style & RECURSE_BIT)) { if (o has supporter) { if (c_style & ENGLISH_BIT) { if (c_style & TERSE_BIT) L__M(##ListMiscellany, 19, o); else L__M(##ListMiscellany, 20, o); if (o has animate) print (string) WHOM__TX; else print (string) WHICH__TX; } recurse_flag = true; } if (o has container && (o has open || o has transparent)) { if (c_style & ENGLISH_BIT) { if (c_style & TERSE_BIT) L__M(##ListMiscellany, 21, o); else L__M(##ListMiscellany, 22, o); if (o has animate) print (string) WHOM__TX; else print (string) WHICH__TX; } recurse_flag = true; } } if (recurse_flag && (c_style & ENGLISH_BIT)) if (child_count > 1 || eldest_child has pluralname) print (string) ARE2__TX; else print (string) IS2__TX; if (c_style & NEWLINE_BIT) new_line; if (recurse_flag) { o = child(o); @push lt_value; @push listing_together; @push listing_size; @push c_iterator; c_iterator = ObjectTreeIterator; lt_value = 0; listing_together = 0; listing_size = 0; WriteListR(o, depth+1, true); @pull c_iterator; @pull listing_size; @pull listing_together; @pull lt_value; if (c_style & TERSE_BIT) print ")"; } ]; [ DigitToValue c n; n = c-'0'; if ((n<0) || (n>9)) return -1; return n; ]; [ GenerateRandomNumber n m s; if (n==m) return n; if (n>m) { s = n; n = m; m = s; } n--; return random(m-n) + n; ]; [ GroupChildren par prop value; while (child(par) ~= 0) { if (child(par).prop ~= value) move child(par) to out_obj; else move child(par) to in_obj; } while (child(in_obj) ~= 0) move child(in_obj) to par; while (child(out_obj) ~= 0) move child(out_obj) to par; return child(par); ]; [ PrintSpaces n; while (n > 0) { print " "; n = n - 1; } ]; [ RunRoutines obj prop; if (obj == thedark) obj = real_location; if ((obj.&prop == 0) && (prop >= INDIV_PROP_START)) rfalse; return obj.prop(); ]; [ SwapWorkflags obj lst; objectloop (obj ofclass Object) { lst = false; if (obj has workflag2) lst = true; give obj ~workflag2; if (obj has workflag) give obj workflag2; give obj ~workflag; if (lst) give obj workflag; } ]; [ TestUseOption UO; if (UO == 0) rtrue; if (UO == 2) rtrue; if (UO == 5) rtrue; if (UO == 9) rtrue; if (UO == 18) rtrue; rfalse; ]; [ IntegerDivide A B; if (B == 0) { RunTimeProblem(RTP_DIVZERO); rfalse; } return A/B; ]; [ IntegerRemainder A B; if (B == 0) { RunTimeProblem(RTP_DIVZERO); rfalse; } return A%B; ]; [ UnsignedCompare x y u v; if (x == y) return 0; if (x < 0 && y >= 0) return 1; if (x >= 0 && y < 0) return -1; u = x&~WORD_HIGHBIT; v= y&~WORD_HIGHBIT; if (u > v) return 1; return -1; ]; [ ZRegion addr; switch (metaclass(addr)) { nothing: return 0; Object, Class: return 1; Routine: return 2; String: return 3; } ]; [ GL__M a b c d; if ((actor ~= player) || (untouchable_silence)) rtrue; return L__M(a,b,c,d); ]; [ AGL__M a b c d; if (untouchable_silence) rtrue; return L__M(a,b,c,d); ]; Object InformParser "(Inform Parser)" has proper; Global best_etype; ! Preferred error number so far Global nextbest_etype; ! Preferred one, if ASKSCOPE_PE disallowed Global parser_inflection; ! A property (usually "name") to find object names in Array pattern --> 32; ! For the current pattern match Global pcount; ! and a marker within it Array pattern2 --> 32; ! And another, which stores the best match Global pcount2; ! so far Array line_ttype-->32; ! For storing an analysed grammar line Array line_tdata-->32; Array line_token-->32; Global nsns; ! Number of special_numbers entered so far Global params_wanted; ! Number of parameters needed (which may change in parsing) Global inferfrom; ! The point from which the rest of the command must be inferred Global inferword; ! And the preposition inferred Global dont_infer; ! Another dull flag Global cobj_flag = 0; Global oops_from; ! The "first mistake" word number Global saved_oops; ! Used in working this out Array oops_workspace -> 64; ! Used temporarily by "oops" routine Global held_back_mode; ! Flag: is there some input from last time Global hb_wn; ! left over? (And a save value for wn.) ! (Used for full stops and "then".) Global usual_grammar_after; ! Point from which usual grammar is parsed (it may vary from ! the above if user's routines match multi-word verbs) Constant PATTERN_NULL = $ffff; ! Entry for a token producing no text Global found_ttype; ! Used to break up tokens into type Global found_tdata; ! and data (by AnalyseToken) Global token_filter; ! For noun filtering by user routines Global length_of_noun; ! Set by NounDomain to no of words in noun Global lookahead; ! The token after the one now being matched Global multi_mode; ! Multiple mode Global multi_wanted; ! Number of things needed in multitude Global multi_had; ! Number of things actually found Global multi_context; ! What token the multi-obj was accepted for Global indef_mode; ! "Indefinite" mode - ie, "take a brick" ! is in this mode Global indef_type; ! Bit-map holding types of specification Global indef_wanted; ! Number of items wanted (INDEF_ALL_WANTED for all) Constant INDEF_ALL_WANTED = 32767; Global indef_guess_p; ! Plural-guessing flag Global indef_owner; ! Object which must hold these items Global indef_cases; ! Possible gender and numbers of them Global indef_possambig; ! Has a possibly dangerous assumption ! been made about meaning of a descriptor? Global indef_nspec_at; ! Word at which a number like "two" was parsed ! (for backtracking) Global allow_plurals; ! Whether plurals presently allowed or not Global take_all_rule; ! Slightly different rules apply to "take all" than other uses ! of multiple objects, to make adjudication produce more ! pragmatically useful results ! (Not a flag: possible values 0, 1, 2) Global dict_flags_of_noun; ! Of the noun currently being parsed ! (a bitmap in #dict_par1 format) Global pronoun__word; ! Saved value Global pronoun__obj; ! Saved value Constant comma_word = 'comma,'; ! An "untypeable word" used to substitute ! for commas in parse buffers Array match_list --> MATCH_LIST_WORDS; ! An array of matched objects so far Array match_classes --> MATCH_LIST_WORDS; ! An array of equivalence classes for them Array match_scores --> MATCH_LIST_WORDS; ! An array of match scores for them Global number_matched; ! How many items in it? (0 means none) Global number_of_classes; ! How many equivalence classes? Global match_length; ! How many words long are these matches? Global match_from; ! At what word of the input do they begin? #Ifdef TARGET_ZCODE; [ WordCount; return parse->1; ]; [ WordAddress wordnum; return buffer + parse->(wordnum*4+1); ]; [ WordLength wordnum; return parse->(wordnum*4); ]; [ MoveWord at1 b2 at2 x y; x = at1*2-1; y = at2*2-1; parse-->x++ = b2-->y++; parse-->x = b2-->y; ]; #Ifnot; [ WordCount; return parse-->0; ]; [ WordAddress wordnum; return buffer + parse-->(wordnum*3); ]; [ WordLength wordnum; return parse-->(wordnum*3-1); ]; [ MoveWord at1 b2 at2 x y; x = at1*3-2; y = at2*3-2; parse-->x++ = b2-->y++; parse-->x++ = b2-->y++; parse-->x = b2-->y; ]; #Endif; [ NextWord i j wc; #Ifdef TARGET_ZCODE; wc = parse->1; i = wn*2-1; #Ifnot; wc = parse-->0; i = wn*3-2; #Endif; wn++; if ((wn < 2) || (wn > wc+1)) return 0; j = parse-->i; if (j == ',//') j = comma_word; if (j == './/') j = THEN1__WD; return j; ]; [ NextWordStopped wc; #Ifdef TARGET_ZCODE; wc = parse->1; #Ifnot; wc = parse-->0; #Endif; if ((wn < 1) || (wn > wc)) { wn++; return -1; } return NextWord(); ]; [ PrintSnippet snip from to i w1 w2; w1 = snip/100; w2 = w1 + (snip%100) - 1; if ((w2WordCount())) return RunTimeProblem(RTP_SAYINVALIDSNIPPET, w1, w2); from = WordAddress(w1); to = WordAddress(w2) + WordLength(w2) - 1; for (i=from: i<=to: i++) print (char) i->0; ]; [ SpliceSnippet snip t i w1 w2 nextw at endsnippet newlen; w1 = snip/100; w2 = w1 + (snip%100) - 1; if ((w2WordCount())) return RunTimeProblem(RTP_SPLICEINVALIDSNIPPET, w1, w2); @push say__p; @push say__pc; nextw = w2 + 1; at = WordAddress(w1) - buffer; if (nextw <= WordCount()) endsnippet = 100*nextw + (WordCount() - nextw + 1); buffer2-->0 = 120; newlen = VM_PrintToBuffer(buffer2, 120, SpliceSnippet__TextPrinter, t, endsnippet); for (i=0: (i(at+i) = buffer2->(WORDSIZE+i); #Ifdef TARGET_ZCODE; buffer->1 = at+i; #ifnot; buffer-->0 = at+i; #endif; for (:at+i<120:i++) buffer->(at+i) = ' '; VM_Tokenise(buffer, parse); players_command = 100 + WordCount(); @pull say__pc; @pull say__p; ]; [ SpliceSnippet__TextPrinter t endsnippet; PrintText(t); if (endsnippet) { print " "; PrintSnippet(endsnippet); } ]; [ SnippetIncludes test snippet w1 w2 wlen i j; w1 = snippet/100; w2 = w1 + (snippet%100) - 1; if ((w20: i++, j--) { if (((test)(i, 0)) ~= GPR_FAIL) return i*100+wn-i; } } rfalse; ]; [ SnippetMatches snippet topic_gpr rv; wn=1; if (topic_gpr == 0) rfalse; if (metaclass(topic_gpr) == Routine) { rv = (topic_gpr)(snippet/100, snippet%100); if (rv ~= GPR_FAIL) rtrue; rfalse; } RunTimeProblem(RTP_BADTOPIC); rfalse; ]; [ UnpackGrammarLine line_address i size; for (i=0 : i<32 : i++) { line_token-->i = ENDIT_TOKEN; line_ttype-->i = ELEMENTARY_TT; line_tdata-->i = ENDIT_TOKEN; } #Ifdef TARGET_ZCODE; action_to_be = 256*(line_address->0) + line_address->1; action_reversed = ((action_to_be & $400) ~= 0); action_to_be = action_to_be & $3ff; line_address--; size = 3; #Ifnot; ! GLULX @aloads line_address 0 action_to_be; action_reversed = (((line_address->2) & 1) ~= 0); line_address = line_address - 2; size = 5; #Endif; params_wanted = 0; for (i=0 : : i++) { line_address = line_address + size; if (line_address->0 == ENDIT_TOKEN) break; line_token-->i = line_address; AnalyseToken(line_address); if (found_ttype ~= PREPOSITION_TT) params_wanted++; line_ttype-->i = found_ttype; line_tdata-->i = found_tdata; } return line_address + 1; ]; [ AnalyseToken token; if (token == ENDIT_TOKEN) { found_ttype = ELEMENTARY_TT; found_tdata = ENDIT_TOKEN; return; } found_ttype = (token->0) & $$1111; found_tdata = (token+1)-->0; ]; [ DictionaryWordToVerbNum dword verbnum; #Ifdef TARGET_ZCODE; verbnum = $ff-(dword->#dict_par2); #Ifnot; ! GLULX dword = dword + #dict_par2 - 1; @aloads dword 0 verbnum; verbnum = $ffff-verbnum; #Endif; return verbnum; ]; [ KeyboardPrimitive a_buffer a_table; #Ifdef DEBUG; #Iftrue (1 > 0); return TestKeyboardPrimitive(a_buffer, a_table); #Endif; #Endif; return VM_ReadKeyboard(a_buffer, a_table); ]; [ Keyboard a_buffer a_table nw i w w2 x1 x2; sline1 = score; sline2 = turns; while (true) { ! Save the start of the buffer, in case "oops" needs to restore it for (i=0 : i<64 : i++) oops_workspace->i = a_buffer->i; ! In case of an array entry corruption that shouldn't happen, but would be ! disastrous if it did: #Ifdef TARGET_ZCODE; a_buffer->0 = INPUT_BUFFER_LEN; a_table->0 = 15; ! Allow to split input into this many words #Endif; ! TARGET_ ! Print the prompt, and read in the words and dictionary addresses PrintPrompt(); DrawStatusLine(); KeyboardPrimitive(a_buffer, a_table); ! Set nw to the number of words #Ifdef TARGET_ZCODE; nw = a_table->1; #Ifnot; nw = a_table-->0; #Endif; ! If the line was blank, get a fresh line if (nw == 0) { @push etype; etype = BLANKLINE_PE; players_command = 100; BeginActivity(PRINTING_A_PARSER_ERROR_ACT); if (ForActivity(PRINTING_A_PARSER_ERROR_ACT) == false) L__M(##Miscellany,10); EndActivity(PRINTING_A_PARSER_ERROR_ACT); @pull etype; continue; } ! Unless the opening word was OOPS, return ! Conveniently, a_table-->1 is the first word on both the Z-machine and Glulx w = a_table-->1; if (w == OOPS1__WD or OOPS2__WD or OOPS3__WD) { if (oops_from == 0) { L__M(##Miscellany, 14); continue; } if (nw == 1) { L__M(##Miscellany, 15); continue; } if (nw > 2) { L__M(##Miscellany, 16); continue; } ! So now we know: there was a previous mistake, and the player has ! attempted to correct a single word of it. for (i=0 : ii = a_buffer->i; #Ifdef TARGET_ZCODE; x1 = a_table->9; ! Start of word following "oops" x2 = a_table->8; ! Length of word following "oops" #Ifnot; ! TARGET_GLULX x1 = a_table-->6; ! Start of word following "oops" x2 = a_table-->5; ! Length of word following "oops" #Endif; ! TARGET_ ! Repair the buffer to the text that was in it before the "oops" ! was typed: for (i=0 : i<64 : i++) a_buffer->i = oops_workspace->i; VM_Tokenise(a_buffer,a_table); ! Work out the position in the buffer of the word to be corrected: #Ifdef TARGET_ZCODE; w = a_table->(4*oops_from + 1); ! Start of word to go w2 = a_table->(4*oops_from); ! Length of word to go #Ifnot; ! TARGET_GLULX w = a_table-->(3*oops_from); ! Start of word to go w2 = a_table-->(3*oops_from - 1); ! Length of word to go #Endif; ! TARGET_ ! Write spaces over the word to be corrected: for (i=0 : i(i+w) = ' '; if (w2 < x2) { ! If the replacement is longer than the original, move up... for (i=INPUT_BUFFER_LEN-1 : i>=w+x2 : i--) a_buffer->i = a_buffer->(i-x2+w2); ! ...increasing buffer size accordingly. #Ifdef TARGET_ZCODE; a_buffer->1 = (a_buffer->1) + (x2-w2); #Ifnot; ! TARGET_GLULX a_buffer-->0 = (a_buffer-->0) + (x2-w2); #Endif; ! TARGET_ } ! Write the correction in: for (i=0 : i(i+w) = buffer2->(i+x1); VM_Tokenise(a_buffer, a_table); #Ifdef TARGET_ZCODE; nw = a_table->1; #Ifnot; nw = a_table-->0; #Endif; return nw; } ! Undo handling if ((w == UNDO1__WD or UNDO2__WD or UNDO3__WD) && (nw==1)) { Perform_Undo(); continue; } i = VM_Save_Undo(); #ifdef PREVENT_UNDO; undo_flag = 0; #endif; #ifndef PREVENT_UNDO; undo_flag = 2; #endif; if (i == -1) undo_flag = 0; if (i == 0) undo_flag = 1; if (i == 2) { VM_RestoreWindowColours(); VM_Style(SUBHEADER_VMSTY); SL_Location(); print "^"; ! print (name) location, "^"; VM_Style(NORMAL_VMSTY); L__M(##Miscellany, 13); continue; } return nw; } ]; [ Parser__parse results syntax line num_lines line_address i j k token l m; cobj_flag = 0; results-->0 = 0; results-->1 = 0; results-->2 = 0; results-->3 = 0; meta = false; if (held_back_mode == 1) { held_back_mode = 0; VM_Tokenise(buffer, parse); jump ReParse; } .ReType; cobj_flag = 0; BeginActivity(READING_A_COMMAND_ACT); if (ForActivity(READING_A_COMMAND_ACT)==false) { Keyboard(buffer,parse); players_command = 100 + WordCount(); num_words = WordCount(); } if (EndActivity(READING_A_COMMAND_ACT)) jump ReType; .ReParse; parser_inflection = name; ! Initially assume the command is aimed at the player, and the verb ! is the first word num_words = WordCount(); wn = 1; #Ifdef LanguageToInformese; LanguageToInformese(); ! Re-tokenise: VM_Tokenise(buffer,parse); #Endif; ! LanguageToInformese num_words = WordCount(); k=0; #Ifdef DEBUG; if (parser_trace >= 2) { print "[ "; for (i=0 : i(i*2 + 1); #Ifnot; ! TARGET_GLULX j = parse-->(i*3 + 1); #Endif; ! TARGET_ k = WordAddress(i+1); l = WordLength(i+1); print "~"; for (m=0 : mm; print "~ "; if (j == 0) print "?"; else { #Ifdef TARGET_ZCODE; if (UnsignedCompare(j, HDR_DICTIONARY-->0) >= 0 && UnsignedCompare(j, HDR_HIGHMEMORY-->0) < 0) print (address) j; else print j; #Ifnot; ! TARGET_GLULX if (j->0 == $60) print (address) j; else print j; #Endif; ! TARGET_ } if (i ~= num_words-1) print " / "; } print " ]^"; } #Endif; ! DEBUG verb_wordnum = 1; actor = player; actors_location = ScopeCeiling(player); usual_grammar_after = 0; .AlmostReParse; scope_token = 0; action_to_be = NULL; ! Begin from what we currently think is the verb word .BeginCommand; wn = verb_wordnum; verb_word = NextWordStopped(); ! If there's no input here, we must have something like "person,". if (verb_word == -1) { best_etype = STUCK_PE; jump GiveError; } ! Now try for "again" or "g", which are special cases: don't allow "again" if nothing ! has previously been typed; simply copy the previous text across if (verb_word == AGAIN2__WD or AGAIN3__WD) verb_word = AGAIN1__WD; if (verb_word == AGAIN1__WD) { if (actor ~= player) { L__M(##Miscellany, 20); jump ReType; } #Ifdef TARGET_ZCODE; if (buffer3->1 == 0) { L__M(##Miscellany, 21); jump ReType; } #Ifnot; ! TARGET_GLULX if (buffer3-->0 == 0) { L__M(##Miscellany, 21); jump ReType; } #Endif; ! TARGET_ for (i=0 : ii = buffer3->i; VM_Tokenise(buffer,parse); num_words = WordCount(); players_command = 100 + WordCount(); jump ReParse; } ! Save the present input in case of an "again" next time if (verb_word ~= AGAIN1__WD) for (i=0 : ii = buffer->i; if (usual_grammar_after == 0) { j = verb_wordnum; i = RunRoutines(actor, grammar); #Ifdef DEBUG; if (parser_trace >= 2 && actor.grammar ~= 0 or NULL) print " [Grammar property returned ", i, "]^"; #Endif; ! DEBUG if ((i ~= 0 or 1) && (VM_InvalidDictionaryAddress(i))) { usual_grammar_after = verb_wordnum; i=-i; } if (i == 1) { results-->0 = action; results-->1 = noun; results-->2 = second; rtrue; } if (i ~= 0) { verb_word = i; wn--; verb_wordnum--; } else { wn = verb_wordnum; verb_word = NextWord(); } } else usual_grammar_after = 0; #Ifdef LanguageIsVerb; if (verb_word == 0) { i = wn; verb_word = LanguageIsVerb(buffer, parse, verb_wordnum); wn = i; } #Endif; ! LanguageIsVerb ! If the first word is not listed as a verb, it must be a direction ! or the name of someone to talk to if (verb_word == 0 || ((verb_word->#dict_par1) & 1) == 0) { ! So is the first word an object contained in the special object "compass" ! (i.e., a direction)? This needs use of NounDomain, a routine which ! does the object matching, returning the object number, or 0 if none found, ! or REPARSE_CODE if it has restructured the parse table so the whole parse ! must be begun again... wn = verb_wordnum; indef_mode = false; token_filter = 0; parameters = 0; @push actor; @push action; @push action_to_be; actor = player; meta = false; action = ##Go; action_to_be = ##Go; l = NounDomain(compass, 0, 0); @pull action_to_be; @pull action; @pull actor; if (l == REPARSE_CODE) jump ReParse; ! If it is a direction, send back the results: ! action=GoSub, no of arguments=1, argument 1=the direction. if ((l~=0) && (l ofclass K3_direction)) { results-->0 = ##Go; results-->1 = 1; results-->2 = l; jump LookForMore; } ! Only check for a comma (a "someone, do something" command) if we are ! not already in the middle of one. (This simplification stops us from ! worrying about "robot, wizard, you are an idiot", telling the robot to ! tell the wizard that she is an idiot.) if (actor == player) { for (j=2 : j<=num_words : j++) { i=NextWord(); if (i == comma_word) jump Conversation; } verb_word = UnknownVerb(verb_word); if (verb_word ~= 0) jump VerbAccepted; } best_etype = VERB_PE; jump GiveError; ! NextWord nudges the word number wn on by one each time, so we've now ! advanced past a comma. (A comma is a word all on its own in the table.) .Conversation; j = wn - 1; if (j == 1) { L__M(##Miscellany, 22); jump ReType; } ! Use NounDomain (in the context of "animate creature") to see if the ! words make sense as the name of someone held or nearby wn = 1; lookahead = HELD_TOKEN; scope_reason = TALKING_REASON; l = NounDomain(player,actors_location,6); scope_reason = PARSING_REASON; if (l == REPARSE_CODE) jump ReParse; if (l == 0) { L__M(##Miscellany, 23); jump ReType; } .Conversation2; ! The object addressed must at least be "talkable" if not actually "animate" ! (the distinction allows, for instance, a microphone to be spoken to, ! without the parser thinking that the microphone is human). if (l hasnt animate && l hasnt talkable) { L__M(##Miscellany, 24, l); jump ReType; } ! Check that there aren't any mystery words between the end of the person's ! name and the comma (eg, throw out "dwarf sdfgsdgs, go north"). if (wn ~= j) { L__M(##Miscellany, 25); jump ReType; } ! The player has now successfully named someone. Adjust "him", "her", "it": PronounNotice(l); ! Set the global variable "actor", adjust the number of the first word, ! and begin parsing again from there. verb_wordnum = j + 1; ! Stop things like "me, again": if (l == player) { wn = verb_wordnum; if (NextWordStopped() == AGAIN1__WD or AGAIN2__WD or AGAIN3__WD) { L__M(##Miscellany, 20); jump ReType; } } actor = l; actors_location = ScopeCeiling(l); #Ifdef DEBUG; if (parser_trace >= 1) print "[Actor is ", (the) actor, " in ", (name) actors_location, "]^"; #Endif; ! DEBUG jump BeginCommand; } ! end of first-word-not-a-verb .VerbAccepted; ! We now definitely have a verb, not a direction, whether we got here by the ! "take ..." or "person, take ..." method. Get the meta flag for this verb: meta = ((verb_word->#dict_par1) & 2)/2; ! You can't order other people to "full score" for you, and so on... if (meta == 1 && actor ~= player) { best_etype = VERB_PE; meta = 0; jump GiveError; } ! Now let i be the corresponding verb number... i = DictionaryWordToVerbNum(verb_word); ! ...then look up the i-th entry in the verb table, whose address is at word ! 7 in the Z-machine (in the header), so as to get the address of the syntax ! table for the given verb... #Ifdef TARGET_ZCODE; syntax = (HDR_STATICMEMORY-->0)-->i; #Ifnot; ! TARGET_GLULX syntax = (#grammar_table)-->(i+1); #Endif; ! TARGET_ ! ...and then see how many lines (ie, different patterns corresponding to the ! same verb) are stored in the parse table... num_lines = (syntax->0) - 1; ! ...and now go through them all, one by one. ! To prevent pronoun_word 0 being misunderstood, pronoun_word = NULL; pronoun_obj = NULL; #Ifdef DEBUG; if (parser_trace >= 1) print "[Parsing for the verb '", (address) verb_word, "' (", num_lines+1, " lines)]^"; #Endif; ! DEBUG best_etype = STUCK_PE; nextbest_etype = STUCK_PE; multiflag = false; ! "best_etype" is the current failure-to-match error - it is by default ! the least informative one, "don't understand that sentence". ! "nextbest_etype" remembers the best alternative to having to ask a ! scope token for an error message (i.e., the best not counting ASKSCOPE_PE). ! multiflag is used here to prevent inappropriate MULTI_PE errors ! in addition to its unrelated duties passing information to action routines line_address = syntax + 1; for (line=0 : line<=num_lines : line++) { for (i=0 : i<32 : i++) { line_token-->i = ENDIT_TOKEN; line_ttype-->i = ELEMENTARY_TT; line_tdata-->i = ENDIT_TOKEN; } ! Unpack the syntax line from Inform format into three arrays; ensure that ! the sequence of tokens ends in an ENDIT_TOKEN. line_address = UnpackGrammarLine(line_address); #Ifdef DEBUG; if (parser_trace >= 1) { if (parser_trace >= 2) new_line; print "[line ", line; DebugGrammarLine(); print "]^"; } #Endif; ! DEBUG ! We aren't in "not holding" or inferring modes, and haven't entered ! any parameters on the line yet, or any special numbers; the multiple ! object is still empty. inferfrom = 0; parameters = 0; nsns = 0; special_word = 0; multiple_object-->0 = 0; multi_context = 0; etype = STUCK_PE; ! Put the word marker back to just after the verb wn = verb_wordnum+1; advance_warning = -1; indef_mode = false; for (i=0,m=false,pcount=0 : line_token-->pcount ~= ENDIT_TOKEN : pcount++) { scope_token = 0; if (line_ttype-->pcount ~= PREPOSITION_TT) i++; if (line_ttype-->pcount == ELEMENTARY_TT) { if (line_tdata-->pcount == MULTI_TOKEN) m = true; if (line_tdata-->pcount == MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN && i == 1) { ! First non-preposition is "multiexcept" or ! "multiinside", so look ahead. #Ifdef DEBUG; if (parser_trace >= 2) print " [Trying look-ahead]^"; #Endif; ! DEBUG ! We need this to be followed by 1 or more prepositions. pcount++; if (line_ttype-->pcount == PREPOSITION_TT) { ! skip ahead to a preposition word in the input do { l = NextWord(); } until ((wn > num_words) || (l && (l->#dict_par1) & 8 ~= 0)); if (wn > num_words) { #Ifdef DEBUG; if (parser_trace >= 2) print " [Look-ahead aborted: prepositions missing]^"; #Endif; jump LineFailed; } do { if (PrepositionChain(l, pcount) ~= -1) { ! advance past the chain if ((line_token-->pcount)->0 & $20 ~= 0) { pcount++; while ((line_token-->pcount ~= ENDIT_TOKEN) && ((line_token-->pcount)->0 & $10 ~= 0)) pcount++; } else { pcount++; } } else { ! try to find another preposition word do { l = NextWord(); } until ((wn >= num_words) || (l && (l->#dict_par1) & 8 ~= 0)); if (l && (l->#dict_par1) & 8) continue; ! lookahead failed #Ifdef DEBUG; if (parser_trace >= 2) print " [Look-ahead aborted: prepositions don't match]^"; #endif; jump LineFailed; } l = NextWord(); } until (line_ttype-->pcount ~= PREPOSITION_TT); ! put back the non-preposition we just read wn--; if ((line_ttype-->pcount == ELEMENTARY_TT) && (line_tdata-->pcount == NOUN_TOKEN)) { l = Descriptors(); ! skip past THE etc if (l~=0) etype=l; ! don't allow multiple objects k = parser_results-->2; @push k; @push parameters; parameters = 1; parser_results-->2 = 0; l = NounDomain(actors_location, actor, NOUN_TOKEN); @pull parameters; @pull k; parser_results-->2 = k; #Ifdef DEBUG; if (parser_trace >= 2) { print " [Advanced to ~noun~ token: "; if (l == REPARSE_CODE) print "re-parse request]^"; else { if (l == 1) print "but multiple found]^"; if (l == 0) print "error ", etype, "]^"; if (l >= 2) print (the) l, "]^"; } } #Endif; ! DEBUG if (l == REPARSE_CODE) jump ReParse; if (l >= 2) advance_warning = l; } } break; } } } ! Slightly different line-parsing rules will apply to "take multi", to ! prevent "take all" behaving correctly but misleadingly when there's ! nothing to take. take_all_rule = 0; if (m && params_wanted == 1 && action_to_be == ##Take) take_all_rule = 1; ! And now start again, properly, forearmed or not as the case may be. ! As a precaution, we clear all the variables again (they may have been ! disturbed by the call to NounDomain, which may have called outside ! code, which may have done anything!). inferfrom = 0; parameters = 0; nsns = 0; special_word = 0; multiple_object-->0 = 0; etype = STUCK_PE; wn = verb_wordnum+1; for (pcount=1 : : pcount++) { pattern-->pcount = PATTERN_NULL; scope_token = 0; token = line_token-->(pcount-1); lookahead = line_token-->pcount; #Ifdef DEBUG; if (parser_trace >= 2) print " [line ", line, " token ", pcount, " word ", wn, " : ", (DebugToken) token, "]^"; #Endif; ! DEBUG if (token ~= ENDIT_TOKEN) { scope_reason = PARSING_REASON; AnalyseToken(token); l = ParseToken(found_ttype, found_tdata, pcount-1, token); while ((l >= GPR_NOUN) && (l < -1)) l = ParseToken(ELEMENTARY_TT, l + 256); scope_reason = PARSING_REASON; if (l == GPR_PREPOSITION) { if (found_ttype~=PREPOSITION_TT && (found_ttype~=ELEMENTARY_TT || found_tdata~=TOPIC_TOKEN)) params_wanted--; l = true; } else if (l < 0) l = false; else if (l ~= GPR_REPARSE) { if (l == GPR_NUMBER) { if (nsns == 0) special_number1 = parsed_number; else special_number2 = parsed_number; nsns++; l = 1; } if (l == GPR_MULTIPLE) l = 0; results-->(parameters+2) = l; parameters++; pattern-->pcount = l; l = true; } #Ifdef DEBUG; if (parser_trace >= 3) { print " [token resulted in "; if (l == REPARSE_CODE) print "re-parse request]^"; if (l == 0) print "failure with error type ", etype, "]^"; if (l == 1) print "success]^"; } #Endif; ! DEBUG if (l == REPARSE_CODE) jump ReParse; if (l == false) break; } else { ! If the player has entered enough already but there's still ! text to wade through: store the pattern away so as to be able to produce ! a decent error message if this turns out to be the best we ever manage, ! and in the mean time give up on this line ! However, if the superfluous text begins with a comma or "then" then ! take that to be the start of another instruction if (wn <= num_words) { l = NextWord(); if (l == THEN1__WD or THEN2__WD or THEN3__WD or comma_word) { held_back_mode = 1; hb_wn = wn-1; } else { for (m=0 : m<32 : m++) pattern2-->m = pattern-->m; pcount2 = pcount; etype = UPTO_PE; break; } } ! Now, we may need to revise the multiple object because of the single one ! we now know (but didn't when the list was drawn up). if (parameters >= 1 && results-->2 == 0) { l = ReviseMulti(results-->3); if (l ~= 0) { etype = l; results-->0 = action_to_be; break; } } if (parameters >= 2 && results-->3 == 0) { l = ReviseMulti(results-->2); if (l ~= 0) { etype = l; break; } } ! To trap the case of "take all" inferring only "yourself" when absolutely ! nothing else is in the vicinity... if (take_all_rule == 2 && results-->2 == actor) { best_etype = NOTHING_PE; jump GiveError; } #Ifdef DEBUG; if (parser_trace >= 1) print "[Line successfully parsed]^"; #Endif; ! DEBUG ! The line has successfully matched the text. Declare the input error-free... oops_from = 0; ! ...explain any inferences made (using the pattern)... if (inferfrom ~= 0) { PrintInferredCommand(inferfrom); ClearParagraphing(); } ! ...copy the action number, and the number of parameters... results-->0 = action_to_be; results-->1 = parameters; ! ...reverse first and second parameters if need be... if (action_reversed && parameters == 2) { i = results-->2; results-->2 = results-->3; results-->3 = i; if (nsns == 2) { i = special_number1; special_number1 = special_number2; special_number2 = i; } } ! ...and to reset "it"-style objects to the first of these parameters, if ! there is one (and it really is an object)... if (parameters > 0 && results-->2 >= 2) PronounNotice(results-->2); ! ...and return from the parser altogether, having successfully matched ! a line. if (held_back_mode == 1) { wn=hb_wn; jump LookForMore; } rtrue; } ! end of if(token ~= ENDIT_TOKEN) else } ! end of for(pcount++) .LineFailed; ! The line has failed to match. ! We continue the outer "for" loop, trying the next line in the grammar. if (etype > best_etype) best_etype = etype; if (etype ~= ASKSCOPE_PE && etype > nextbest_etype) nextbest_etype = etype; ! ...unless the line was something like "take all" which failed because ! nothing matched the "all", in which case we stop and give an error now. if (take_all_rule == 2 && etype==NOTHING_PE) break; } ! end of for(line++) ! The grammar is exhausted: every line has failed to match. .GiveError; etype = best_etype; if (actor ~= player) { if (usual_grammar_after ~= 0) { verb_wordnum = usual_grammar_after; jump AlmostReParse; } wn = verb_wordnum; special_word = NextWord(); if (special_word == comma_word) { special_word = NextWord(); verb_wordnum++; } results-->0 = ##Answer; results-->1 = 2; results-->2 = actor; results-->3 = 1; special_number1 = special_word; actor = player; consult_from = verb_wordnum; consult_words = num_words-consult_from+1; rtrue; } ! If the player was the actor (eg, in "take dfghh") the error must be printed, ! and fresh input called for. In three cases the oops word must be jiggled. if ((etype ofclass Routine) || (etype ofclass String)) { if (ParserError(etype) ~= 0) jump ReType; } else { if (verb_wordnum == 0 && etype == CANTSEE_PE) etype = VERB_PE; players_command = 100 + WordCount(); ! The snippet variable ``player's command'' BeginActivity(PRINTING_A_PARSER_ERROR_ACT); if (ForActivity(PRINTING_A_PARSER_ERROR_ACT)) jump SkipParserError; } pronoun_word = pronoun__word; pronoun_obj = pronoun__obj; if (etype == STUCK_PE) { L__M(##Miscellany, 27); oops_from = 1; } if (etype == UPTO_PE) { L__M(##Miscellany, 28); for (m=0 : m<32 : m++) pattern-->m = pattern2-->m; pcount = pcount2; PrintCommand(0); L__M(##Miscellany, 56); } if (etype == NUMBER_PE) L__M(##Miscellany, 29); if (etype == CANTSEE_PE) { L__M(##Miscellany, 30); oops_from=saved_oops; } if (etype == TOOLIT_PE) L__M(##Miscellany, 31); if (etype == NOTHELD_PE) { L__M(##Miscellany, 32); oops_from=saved_oops; } if (etype == MULTI_PE) L__M(##Miscellany, 33); if (etype == MMULTI_PE) L__M(##Miscellany, 34); if (etype == VAGUE_PE) L__M(##Miscellany, 35); if (etype == EXCEPT_PE) L__M(##Miscellany, 36); if (etype == ANIMA_PE) L__M(##Miscellany, 37); if (etype == VERB_PE) L__M(##Miscellany, 38); if (etype == SCENERY_PE) L__M(##Miscellany, 39); if (etype == ITGONE_PE) { if (pronoun_obj == NULL) L__M(##Miscellany, 35); else L__M(##Miscellany, 40); } if (etype == JUNKAFTER_PE) L__M(##Miscellany, 41); if (etype == TOOFEW_PE) L__M(##Miscellany, 42, multi_had); if (etype == NOTHING_PE) { if (results-->0 == ##Remove && results-->3 ofclass Object) { noun = results-->3; ! ensure valid for messages if (noun has animate) L__M(##Take, 6, noun); else if (noun hasnt container or supporter) L__M(##Insert, 2, noun); else if (noun has container && noun hasnt open) L__M(##Take, 9, noun); else if (children(noun)==0) L__M(##Search, 6, noun); else results-->0 = 0; } if (results-->0 ~= ##Remove) { if (multi_wanted==100) L__M(##Miscellany, 43); else L__M(##Miscellany, 44); } } if (etype == ASKSCOPE_PE) { scope_stage = 3; if (indirect(scope_error) == -1) { best_etype = nextbest_etype; if (~~((etype ofclass Routine) || (etype ofclass String))) EndActivity(PRINTING_A_PARSER_ERROR_ACT); jump GiveError; } } if (etype == NOTINCONTEXT_PE) L__M(##Miscellany, 73); .SkipParserError; if ((etype ofclass Routine) || (etype ofclass String)) jump ReType; say__p = 1; EndActivity(PRINTING_A_PARSER_ERROR_ACT); ! And go (almost) right back to square one... jump ReType; ! ...being careful not to go all the way back, to avoid infinite repetition ! of a deferred command causing an error. ! At this point, the return value is all prepared, and we are only looking ! to see if there is a "then" followed by subsequent instruction(s). .LookForMore; if (wn > num_words) rtrue; i = NextWord(); if (i == THEN1__WD or THEN2__WD or THEN3__WD or comma_word) { if (wn > num_words) { held_back_mode = false; return; } i = WordAddress(verb_wordnum); j = WordAddress(wn); for (: i0 = ' '; i = NextWord(); if (i == AGAIN1__WD or AGAIN2__WD or AGAIN3__WD) { ! Delete the words "then again" from the again buffer, ! in which we have just realised that it must occur: ! prevents an infinite loop on "i. again" i = WordAddress(wn-2)-buffer; if (wn > num_words) j = INPUT_BUFFER_LEN-1; else j = WordAddress(wn)-buffer; for (: ii = ' '; } VM_Tokenise(buffer,parse); held_back_mode = true; return; } best_etype = UPTO_PE; jump GiveError; ]; ! end of Parser__parse [ ParseTokenStopped x y; if (wn>WordCount()) return GPR_FAIL; return ParseToken(x,y); ]; Global parsetoken_nesting = 0; [ ParseToken given_ttype given_tdata token_n token i t rv; if (parsetoken_nesting > 0) { ! save match globals @push match_from; @push token_filter; @push match_length; @push number_of_classes; @push oops_from; for (i=0: ii; @push t; t = match_classes-->i; @push t; t = match_scores-->i; @push t; } @push number_matched; } parsetoken_nesting++; rv = ParseToken__(given_ttype, given_tdata, token_n, token); parsetoken_nesting--; if (parsetoken_nesting > 0) { ! restore match globals @pull number_matched; for (i=0: ii = t; @pull t; match_classes-->i = t; @pull t; match_list-->i = t; } @pull oops_from; @pull number_of_classes; @pull match_length; @pull token_filter; @pull match_from; } return rv; ]; [ ParseToken__ given_ttype given_tdata token_n token l o i j k and_parity single_object desc_wn many_flag token_allows_multiple prev_indef_wanted; token_filter = 0; parser_inflection = name; switch (given_ttype) { ELEMENTARY_TT: switch (given_tdata) { SPECIAL_TOKEN: l = TryNumber(wn); special_word = NextWord(); #Ifdef DEBUG; if (l ~= -1000) if (parser_trace >= 3) print " [Read special as the number ", l, "]^"; #Endif; ! DEBUG if (l == -1000) { #Ifdef DEBUG; if (parser_trace >= 3) print " [Read special word at word number ", wn, "]^"; #Endif; ! DEBUG l = special_word; } parsed_number = l; return GPR_NUMBER; NUMBER_TOKEN: l=TryNumber(wn++); if (l == -1000) { etype = NUMBER_PE; return GPR_FAIL; } #Ifdef DEBUG; if (parser_trace>=3) print " [Read number as ", l, "]^"; #Endif; ! DEBUG parsed_number = l; return GPR_NUMBER; CREATURE_TOKEN: if (action_to_be == ##Answer or ##Ask or ##AskFor or ##Tell) scope_reason = TALKING_REASON; TOPIC_TOKEN: consult_from = wn; if ((line_ttype-->(token_n+1) ~= PREPOSITION_TT) && (line_token-->(token_n+1) ~= ENDIT_TOKEN)) RunTimeError(13); do o = NextWordStopped(); until (o == -1 || PrepositionChain(o, token_n+1) ~= -1); wn--; consult_words = wn-consult_from; if (consult_words == 0) return GPR_FAIL; if (action_to_be == ##Ask or ##Answer or ##Tell) { o = wn; wn = consult_from; parsed_number = NextWord(); wn = o; return 1; } if (o==-1 && (line_ttype-->(token_n+1) == PREPOSITION_TT)) return GPR_FAIL; ! don't infer if required preposition is absent return GPR_PREPOSITION; } PREPOSITION_TT: ! Is it an unnecessary alternative preposition, when a previous choice ! has already been matched? if ((token->0) & $10) return GPR_PREPOSITION; ! If we've run out of the player's input, but still have parameters to ! specify, we go into "infer" mode, remembering where we are and the ! preposition we are inferring... if (wn > num_words) { if (inferfrom==0 && parameterspcount = REPARSE_CODE + VM_DictionaryAddressToNumber(given_tdata); } ! If we are not inferring, then the line is wrong... if (inferfrom == 0) return -1; ! If not, then the line is right but we mark in the preposition... pattern-->pcount = REPARSE_CODE + VM_DictionaryAddressToNumber(given_tdata); return GPR_PREPOSITION; } o = NextWord(); pattern-->pcount = REPARSE_CODE + VM_DictionaryAddressToNumber(o); ! Whereas, if the player has typed something here, see if it is the ! required preposition... if it's wrong, the line must be wrong, ! but if it's right, the token is passed (jump to finish this token). if (o == given_tdata) return GPR_PREPOSITION; if (PrepositionChain(o, token_n) ~= -1) return GPR_PREPOSITION; return -1; GPR_TT: l = indirect(given_tdata); #Ifdef DEBUG; if (parser_trace >= 3) print " [Outside parsing routine returned ", l, "]^"; #Endif; ! DEBUG return l; SCOPE_TT: scope_token = given_tdata; scope_stage = 1; #Ifdef DEBUG; if (parser_trace >= 3) print " [Scope routine called at stage 1]^"; #Endif; ! DEBUG l = indirect(scope_token); #Ifdef DEBUG; if (parser_trace >= 3) print " [Scope routine returned multiple-flag of ", l, "]^"; #Endif; ! DEBUG if (l == 1) given_tdata = MULTI_TOKEN; else given_tdata = NOUN_TOKEN; ATTR_FILTER_TT: token_filter = 1 + given_tdata; given_tdata = NOUN_TOKEN; ROUTINE_FILTER_TT: token_filter = given_tdata; given_tdata = NOUN_TOKEN; } ! end of switch(given_ttype) token = given_tdata; ! There are now three possible ways we can be here: ! parsing an elementary token other than "special" or "number"; ! parsing a scope token; ! parsing a noun-filter token (either by routine or attribute). ! ! In each case, token holds the type of elementary parse to ! perform in matching one or more objects, and ! token_filter is 0 (default), an attribute + 1 for an attribute filter ! or a routine address for a routine filter. token_allows_multiple = false; if (token == MULTI_TOKEN or MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) token_allows_multiple = true; many_flag = false; and_parity = true; dont_infer = false; ! We expect to find a list of objects next in what the player's typed. .ObjectList; #Ifdef DEBUG; if (parser_trace >= 3) print " [Object list from word ", wn, "]^"; #Endif; ! DEBUG ! Take an advance look at the next word: if it's "it" or "them", and these ! are unset, set the appropriate error number and give up on the line ! (if not, these are still parsed in the usual way - it is not assumed ! that they still refer to something in scope) o = NextWord(); wn--; pronoun_word = NULL; pronoun_obj = NULL; l = PronounValue(o); if (l ~= 0) { pronoun_word = o; pronoun_obj = l; if (l == NULL) { ! Don't assume this is a use of an unset pronoun until the ! descriptors have been checked, because it might be an ! article (or some such) instead for (l=1 : l<=LanguageDescriptors-->0 : l=l+4) if (o == LanguageDescriptors-->l) jump AssumeDescriptor; pronoun__word = pronoun_word; pronoun__obj = pronoun_obj; etype = VAGUE_PE; if (parser_trace >= 3) print " [Stop: unset pronoun]^"; return GPR_FAIL; } } .AssumeDescriptor; if (o == ME1__WD or ME2__WD or ME3__WD) { pronoun_word = o; pronoun_obj = player; } allow_plurals = true; desc_wn = wn; .TryAgain; ! First, we parse any descriptive words (like "the", "five" or "every"): l = Descriptors(token_allows_multiple); if (l ~= 0) { etype = l; return 0; } .TryAgain2; ! This is an actual specified object, and is therefore where a typing error ! is most likely to occur, so we set: oops_from = wn; ! So, two cases. Case 1: token not equal to "held" (so, no implicit takes) ! but we may well be dealing with multiple objects ! In either case below we use NounDomain, giving it the token number as ! context, and two places to look: among the actor's possessions, and in the ! present location. (Note that the order depends on which is likeliest.) if (token ~= HELD_TOKEN) { i = multiple_object-->0; #Ifdef DEBUG; if (parser_trace >= 3) print " [Calling NounDomain on location and actor]^"; #Endif; ! DEBUG l = NounDomain(actors_location, actor, token); if (l == REPARSE_CODE) return l; ! Reparse after Q&A if (indef_wanted == INDEF_ALL_WANTED && l == 0 && number_matched == 0) l = 1; ! ReviseMulti if TAKE ALL FROM empty container if (token_allows_multiple && ~~multiflag) { if (best_etype==MULTI_PE) best_etype=STUCK_PE; multiflag = true; } if (l == 0) { if (indef_possambig) { ResetDescriptors(); wn = desc_wn; jump TryAgain2; } if (etype == MULTI_PE or TOOFEW_PE && multiflag) etype = STUCK_PE; etype=CantSee(); jump FailToken; } ! Choose best error #Ifdef DEBUG; if (parser_trace >= 3) { if (l > 1) print " [ND returned ", (the) l, "]^"; else { print " [ND appended to the multiple object list:^"; k = multiple_object-->0; for (j=i+1 : j<=k : j++) print " Entry ", j, ": ", (The) multiple_object-->j, " (", multiple_object-->j, ")^"; print " List now has size ", k, "]^"; } } #Endif; ! DEBUG if (l == 1) { if (~~many_flag) many_flag = true; else { ! Merge with earlier ones k = multiple_object-->0; ! (with either parity) multiple_object-->0 = i; for (j=i+1 : j<=k : j++) { if (and_parity) MultiAdd(multiple_object-->j); else MultiSub(multiple_object-->j); } #Ifdef DEBUG; if (parser_trace >= 3) print " [Merging ", k-i, " new objects to the ", i, " old ones]^"; #Endif; ! DEBUG } } else { ! A single object was indeed found if (match_length == 0 && indef_possambig) { ! So the answer had to be inferred from no textual data, ! and we know that there was an ambiguity in the descriptor ! stage (such as a word which could be a pronoun being ! parsed as an article or possessive). It's worth having ! another go. ResetDescriptors(); wn = desc_wn; jump TryAgain2; } if ((token == CREATURE_TOKEN) && (CreatureTest(l) == 0)) { etype = ANIMA_PE; jump FailToken; } ! Animation is required if (~~many_flag) single_object = l; else { if (and_parity) MultiAdd(l); else MultiSub(l); #Ifdef DEBUG; if (parser_trace >= 3) print " [Combining ", (the) l, " with list]^"; #Endif; ! DEBUG } } } else { ! Case 2: token is "held" (which fortunately can't take multiple objects) ! and may generate an implicit take l = NounDomain(actor,actors_location,token); ! Same as above... if (l == REPARSE_CODE) return l; if (l == 0) { if (indef_possambig) { ResetDescriptors(); wn = desc_wn; jump TryAgain2; } etype = CantSee(); jump FailToken; ! Choose best error } ! ...until it produces something not held by the actor. Then an implicit ! take must be tried. If this is already happening anyway, things are too ! confused and we have to give up (but saving the oops marker so as to get ! it on the right word afterwards). ! The point of this last rule is that a sequence like ! ! > read newspaper ! (taking the newspaper first) ! The dwarf unexpectedly prevents you from taking the newspaper! ! ! should not be allowed to go into an infinite repeat - read becomes ! take then read, but take has no effect, so read becomes take then read... ! Anyway for now all we do is record the number of the object to take. o = parent(l); if (o ~= actor) { #Ifdef DEBUG; if (parser_trace >= 3) print " [Allowing object ", (the) l, " for now]^"; #Endif; ! DEBUG } single_object = l; } ! end of if (token ~= HELD_TOKEN) else ! The following moves the word marker to just past the named object... wn = oops_from + match_length; ! Object(s) specified now: is that the end of the list, or have we reached ! "and", "but" and so on? If so, create a multiple-object list if we ! haven't already (and are allowed to). .NextInList; o = NextWord(); if (o == AND1__WD or AND2__WD or AND3__WD or BUT1__WD or BUT2__WD or BUT3__WD or comma_word) { #Ifdef DEBUG; if (parser_trace >= 3) print " [Read connective '", (address) o, "']^"; #Endif; ! DEBUG if (~~token_allows_multiple) { if (multiflag) jump PassToken; ! give UPTO_PE error etype=MULTI_PE; jump FailToken; } if (o == BUT1__WD or BUT2__WD or BUT3__WD) and_parity = 1-and_parity; if (~~many_flag) { multiple_object-->0 = 1; multiple_object-->1 = single_object; many_flag = true; #Ifdef DEBUG; if (parser_trace >= 3) print " [Making new list from ", (the) single_object, "]^"; #Endif; ! DEBUG } dont_infer = true; inferfrom=0; ! Don't print (inferences) jump ObjectList; ! And back around } wn--; ! Word marker back to first not-understood word ! Happy or unhappy endings: .PassToken; if (many_flag) { single_object = GPR_MULTIPLE; multi_context = token; } else { if (indef_mode == 1 && indef_type & PLURAL_BIT ~= 0) { if (indef_wanted < INDEF_ALL_WANTED && indef_wanted > 1) { multi_had = 1; multi_wanted = indef_wanted; etype = TOOFEW_PE; jump FailToken; } } } return single_object; .FailToken; ! If we were only guessing about it being a plural, try again but only ! allowing singulars (so that words like "six" are not swallowed up as ! Descriptors) if (allow_plurals && indef_guess_p == 1) { #Ifdef DEBUG; if (parser_trace >= 4) print " [Retrying singulars after failure ", etype, "]^"; #Endif; prev_indef_wanted = indef_wanted; allow_plurals = false; wn = desc_wn; jump TryAgain; } if ((indef_wanted > 0 || prev_indef_wanted > 0) && (~~multiflag)) etype = MULTI_PE; return GPR_FAIL; ]; ! end of ParseToken__ Constant OTHER_BIT = 1; ! These will be used in Adjudicate() Constant MY_BIT = 2; ! to disambiguate choices Constant THAT_BIT = 4; Constant PLURAL_BIT = 8; Constant LIT_BIT = 16; Constant UNLIT_BIT = 32; [ ResetDescriptors; indef_mode = 0; indef_type = 0; indef_wanted = 0; indef_guess_p = 0; indef_possambig = false; indef_owner = nothing; indef_cases = $$111111111111; indef_nspec_at = 0; ]; [ ArticleDescriptors o x flag cto type n; if (wn > num_words) return 0; for (flag=true : flag :) { o = NextWordStopped(); flag = false; for (x=1 : x<=LanguageDescriptors-->0 : x=x+4) if (o == LanguageDescriptors-->x) { type = LanguageDescriptors-->(x+2); if (type == DEFART_PK or INDEFART_PK) flag = true; } } wn--; return 0; ]; [ Descriptors o x flag cto type n; ResetDescriptors(); if (wn > num_words) return 0; for (flag=true : flag :) { o = NextWordStopped(); flag = false; for (x=1 : x<=LanguageDescriptors-->0 : x=x+4) if (o == LanguageDescriptors-->x) { flag = true; type = LanguageDescriptors-->(x+2); if (type ~= DEFART_PK) indef_mode = true; indef_possambig = true; indef_cases = indef_cases & (LanguageDescriptors-->(x+1)); if (type == POSSESS_PK) { cto = LanguageDescriptors-->(x+3); switch (cto) { 0: indef_type = indef_type | MY_BIT; 1: indef_type = indef_type | THAT_BIT; default: indef_owner = PronounValue(cto); if (indef_owner == NULL) indef_owner = InformParser; } } if (type == light) indef_type = indef_type | LIT_BIT; if (type == -light) indef_type = indef_type | UNLIT_BIT; } if (o == OTHER1__WD or OTHER2__WD or OTHER3__WD) { indef_mode = 1; flag = 1; indef_type = indef_type | OTHER_BIT; } if (o == ALL1__WD or ALL2__WD or ALL3__WD or ALL4__WD or ALL5__WD) { indef_mode = 1; flag = 1; indef_wanted = INDEF_ALL_WANTED; if (take_all_rule == 1) take_all_rule = 2; indef_type = indef_type | PLURAL_BIT; } if (allow_plurals) { n = NumberWord(o); if (n == 1) { indef_mode = 1; flag = 1; } if (n > 1) { indef_guess_p = 1; indef_mode = 1; flag = 1; indef_wanted = n; indef_nspec_at = wn-1; indef_type = indef_type | PLURAL_BIT; } } if (flag == 1 && NextWordStopped() ~= OF1__WD or OF2__WD or OF3__WD or OF4__WD) wn--; ! Skip 'of' after these } wn--; return 0; ]; [ SafeSkipDescriptors; @push indef_mode; @push indef_type; @push indef_wanted; @push indef_guess_p; @push indef_possambig; @push indef_owner; @push indef_cases; @push indef_nspec_at; Descriptors(); @pull indef_nspec_at; @pull indef_cases; @pull indef_owner; @pull indef_possambig; @pull indef_guess_p; @pull indef_wanted; @pull indef_type; @pull indef_mode; ]; [ PrepositionChain wd index; if (line_tdata-->index == wd) return wd; if ((line_token-->index)->0 & $20 == 0) return -1; do { if (line_tdata-->index == wd) return wd; index++; } until ((line_token-->index == ENDIT_TOKEN) || (((line_token-->index)->0 & $10) == 0)); return -1; ]; [ CreatureTest obj; if (obj has animate) rtrue; if (obj hasnt talkable) rfalse; if (action_to_be == ##Ask or ##Answer or ##Tell or ##AskFor) rtrue; rfalse; ]; [ NounDomain domain1 domain2 context first_word i j k l answer_words marker; #Ifdef DEBUG; if (parser_trace >= 4) { print " [NounDomain called at word ", wn, "^"; print " "; if (indef_mode) { print "seeking indefinite object: "; if (indef_type & OTHER_BIT) print "other "; if (indef_type & MY_BIT) print "my "; if (indef_type & THAT_BIT) print "that "; if (indef_type & PLURAL_BIT) print "plural "; if (indef_type & LIT_BIT) print "lit "; if (indef_type & UNLIT_BIT) print "unlit "; if (indef_owner ~= 0) print "owner:", (name) indef_owner; new_line; print " number wanted: "; if (indef_wanted == INDEF_ALL_WANTED) print "all"; else print indef_wanted; new_line; print " most likely GNAs of names: ", indef_cases, "^"; } else print "seeking definite object^"; } #Endif; ! DEBUG match_length = 0; number_matched = 0; match_from = wn; SearchScope(domain1, domain2, context); #Ifdef DEBUG; if (parser_trace >= 4) print " [ND made ", number_matched, " matches]^"; #Endif; ! DEBUG wn = match_from+match_length; ! If nothing worked at all, leave with the word marker skipped past the ! first unmatched word... if (number_matched == 0) { wn++; rfalse; } ! Suppose that there really were some words being parsed (i.e., we did ! not just infer). If so, and if there was only one match, it must be ! right and we return it... if (match_from <= num_words) { if (number_matched == 1) { i=match_list-->0; return i; } ! ...now suppose that there was more typing to come, i.e. suppose that ! the user entered something beyond this noun. If nothing ought to follow, ! then there must be a mistake, (unless what does follow is just a full ! stop, and or comma) if (wn <= num_words) { i = NextWord(); wn--; if (i ~= AND1__WD or AND2__WD or AND3__WD or comma_word or THEN1__WD or THEN2__WD or THEN3__WD or BUT1__WD or BUT2__WD or BUT3__WD) { if (lookahead == ENDIT_TOKEN) rfalse; } } } ! Now look for a good choice, if there's more than one choice... number_of_classes = 0; if (number_matched == 1) i = match_list-->0; if (number_matched > 1) { i = Adjudicate(context); if (i == -1) rfalse; if (i == 1) rtrue; ! Adjudicate has made a multiple ! object, and we pass it on } ! If i is non-zero here, one of two things is happening: either ! (a) an inference has been successfully made that object i is ! the intended one from the user's specification, or ! (b) the user finished typing some time ago, but we've decided ! on i because it's the only possible choice. ! In either case we have to keep the pattern up to date, ! note that an inference has been made and return. ! (Except, we don't note which of a pile of identical objects.) if (i ~= 0) { if (dont_infer) return i; if (inferfrom == 0) inferfrom=pcount; pattern-->pcount = i; return i; } ! If we get here, there was no obvious choice of object to make. If in ! fact we've already gone past the end of the player's typing (which ! means the match list must contain every object in scope, regardless ! of its name), then it's foolish to give an enormous list to choose ! from - instead we go and ask a more suitable question... if (match_from > num_words) jump Incomplete; ! Now we print up the question, using the equivalence classes as worked ! out by Adjudicate() so as not to repeat ourselves on plural objects... BeginActivity(ASKING_WHICH_DO_YOU_MEAN_ACT); if (ForActivity(ASKING_WHICH_DO_YOU_MEAN_ACT)) jump SkipWhichQuestion; if (context==CREATURE_TOKEN) L__M(##Miscellany, 45); else L__M(##Miscellany, 46); j = number_of_classes; marker = 0; for (i=1 : i<=number_of_classes : i++) { while (((match_classes-->marker) ~= i) && ((match_classes-->marker) ~= -i)) marker++; k = match_list-->marker; if (match_classes-->marker > 0) print (the) k; else print (a) k; if (i < j-1) print (string) COMMA__TX; if (i == j-1) { #Ifdef SERIAL_COMMA; print ","; #Endif; ! SERIAL_COMMA print (string) OR__TX; } } L__M(##Miscellany, 57); .SkipWhichQuestion; EndActivity(ASKING_WHICH_DO_YOU_MEAN_ACT); ! ...and get an answer: .WhichOne; #Ifdef TARGET_ZCODE; for (i=2 : ii = ' '; #Endif; ! TARGET_ZCODE answer_words=Keyboard(buffer2, parse2); ! Conveniently, parse2-->1 is the first word in both ZCODE and GLULX. first_word = (parse2-->1); ! Take care of "all", because that does something too clever here to do ! later on: if (first_word == ALL1__WD or ALL2__WD or ALL3__WD or ALL4__WD or ALL5__WD) { if (context == MULTI_TOKEN or MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { l = multiple_object-->0; for (i=0 : ii; multiple_object-->(i+1+l) = k; } multiple_object-->0 = i+l; rtrue; } L__M(##Miscellany, 47); jump WhichOne; } ! If the first word of the reply can be interpreted as a verb, then ! assume that the player has ignored the question and given a new ! command altogether. ! (This is one time when it's convenient that the directions are ! not themselves verbs - thus, "north" as a reply to "Which, the north ! or south door" is not treated as a fresh command but as an answer.) #Ifdef LanguageIsVerb; if (first_word == 0) { j = wn; first_word = LanguageIsVerb(buffer2, parse2, 1); wn = j; } #Endif; ! LanguageIsVerb if (first_word ~= 0) { j = first_word->#dict_par1; if ((0 ~= j&1) && ~~LanguageVerbMayBeName(first_word)) { VM_CopyBuffer(buffer, buffer2); jump RECONSTRUCT_INPUT; } } ! Now we insert the answer into the original typed command, as ! words additionally describing the same object ! (eg, > take red button ! Which one, ... ! > music ! becomes "take music red button". The parser will thus have three ! words to work from next time, not two.) #Ifdef TARGET_ZCODE; k = WordAddress(match_from) - buffer; l=buffer2->1+1; for (j=buffer + buffer->0 - 1 : j>=buffer+k+l : j--) j->0 = 0->(j-l); for (i=0 : i(k+i) = buffer2->(2+i); buffer->(k+l-1) = ' '; buffer->1 = buffer->1 + l; if (buffer->1 >= (buffer->0 - 1)) buffer->1 = buffer->0; #Ifnot; ! TARGET_GLULX k = WordAddress(match_from) - buffer; l = (buffer2-->0) + 1; for (j=buffer+INPUT_BUFFER_LEN-1 : j>=buffer+k+l : j--) j->0 = j->(-l); for (i=0 : i(k+i) = buffer2->(WORDSIZE+i); buffer->(k+l-1) = ' '; buffer-->0 = buffer-->0 + l; if (buffer-->0 > (INPUT_BUFFER_LEN-WORDSIZE)) buffer-->0 = (INPUT_BUFFER_LEN-WORDSIZE); #Endif; ! TARGET_ ! Having reconstructed the input, we warn the parser accordingly ! and get out. .RECONSTRUCT_INPUT; num_words = WordCount(); wn = 1; #Ifdef LanguageToInformese; LanguageToInformese(); ! Re-tokenise: VM_Tokenise(buffer,parse); #Endif; ! LanguageToInformese num_words = WordCount(); players_command = 100 + WordCount(); FollowRulebook(Activity_after_rulebooks-->READING_A_COMMAND_ACT, true); return REPARSE_CODE; ! Now we come to the question asked when the input has run out ! and can't easily be guessed (eg, the player typed "take" and there ! were plenty of things which might have been meant). .Incomplete; if (context == CREATURE_TOKEN) L__M(##Miscellany, 48); else L__M(##Miscellany, 49); #Ifdef TARGET_ZCODE; for (i=2 : ii=' '; #Endif; ! TARGET_ZCODE answer_words = Keyboard(buffer2, parse2); first_word=(parse2-->1); #Ifdef LanguageIsVerb; if (first_word==0) { j = wn; first_word=LanguageIsVerb(buffer2, parse2, 1); wn = j; } #Endif; ! LanguageIsVerb ! Once again, if the reply looks like a command, give it to the ! parser to get on with and forget about the question... if (first_word ~= 0) { j = first_word->#dict_par1; if (0 ~= j&1) { VM_CopyBuffer(buffer, buffer2); return REPARSE_CODE; } } ! ...but if we have a genuine answer, then: ! ! (1) we must glue in text suitable for anything that's been inferred. if (inferfrom ~= 0) { for (j=inferfrom : jj == PATTERN_NULL) continue; #Ifdef TARGET_ZCODE; i = 2+buffer->1; (buffer->1)++; buffer->(i++) = ' '; #Ifnot; ! TARGET_GLULX i = WORDSIZE + buffer-->0; (buffer-->0)++; buffer->(i++) = ' '; #Endif; ! TARGET_ #Ifdef DEBUG; if (parser_trace >= 5) print "[Gluing in inference with pattern code ", pattern-->j, "]^"; #Endif; ! DEBUG ! Conveniently, parse2-->1 is the first word in both ZCODE and GLULX. parse2-->1 = 0; ! An inferred object. Best we can do is glue in a pronoun. ! (This is imperfect, but it's very seldom needed anyway.) if (pattern-->j >= 2 && pattern-->j < REPARSE_CODE) { PronounNotice(pattern-->j); for (k=1 : k<=LanguagePronouns-->0 : k=k+3) if (pattern-->j == LanguagePronouns-->(k+2)) { parse2-->1 = LanguagePronouns-->k; #Ifdef DEBUG; if (parser_trace >= 5) print "[Using pronoun '", (address) parse2-->1, "']^"; #Endif; ! DEBUG break; } } else { ! An inferred preposition. parse2-->1 = VM_NumberToDictionaryAddress(pattern-->j - REPARSE_CODE); #Ifdef DEBUG; if (parser_trace >= 5) print "[Using preposition '", (address) parse2-->1, "']^"; #Endif; ! DEBUG } ! parse2-->1 now holds the dictionary address of the word to glue in. if (parse2-->1 ~= 0) { k = buffer + i; #Ifdef TARGET_ZCODE; @output_stream 3 k; print (address) parse2-->1; @output_stream -3; k = k-->0; for (l=i : ll = buffer->(l+2); i = i + k; buffer->1 = i-2; #Ifnot; ! TARGET_GLULX k = Glulx_PrintAnyToArray(buffer+i, INPUT_BUFFER_LEN-i, parse2-->1); i = i + k; buffer-->0 = i - WORDSIZE; #Endif; ! TARGET_ } } } ! (2) we must glue the newly-typed text onto the end. #Ifdef TARGET_ZCODE; i = 2+buffer->1; (buffer->1)++; buffer->(i++) = ' '; for (j=0 : j1 : i++,j++) { buffer->i = buffer2->(j+2); (buffer->1)++; if (buffer->1 == INPUT_BUFFER_LEN) break; } #Ifnot; ! TARGET_GLULX i = WORDSIZE + buffer-->0; (buffer-->0)++; buffer->(i++) = ' '; for (j=0 : j0 : i++,j++) { buffer->i = buffer2->(j+WORDSIZE); (buffer-->0)++; if (buffer-->0 == INPUT_BUFFER_LEN) break; } #Endif; ! TARGET_ ! (3) we fill up the buffer with spaces, which is unnecessary, but may ! help incorrectly-written interpreters to cope. #Ifdef TARGET_ZCODE; for (: ii = ' '; #Endif; ! TARGET_ZCODE return REPARSE_CODE; ]; ! end of NounDomain [ Adjudicate context i j k good_ones last n ultimate flag offset; #Ifdef DEBUG; if (parser_trace >= 4) { print " [Adjudicating match list of size ", number_matched, " in context ", context, "^"; print " "; if (indef_mode) { print "indefinite type: "; if (indef_type & OTHER_BIT) print "other "; if (indef_type & MY_BIT) print "my "; if (indef_type & THAT_BIT) print "that "; if (indef_type & PLURAL_BIT) print "plural "; if (indef_type & LIT_BIT) print "lit "; if (indef_type & UNLIT_BIT) print "unlit "; if (indef_owner ~= 0) print "owner:", (name) indef_owner; new_line; print " number wanted: "; if (indef_wanted == INDEF_ALL_WANTED) print "all"; else print indef_wanted; new_line; print " most likely GNAs of names: ", indef_cases, "^"; } else print "definite object^"; } #Endif; ! DEBUG j = number_matched-1; good_ones = 0; last = match_list-->0; for (i=0 : i<=j : i++) { n = match_list-->i; match_scores-->i = good_ones; ultimate = ScopeCeiling(n); if (context==HELD_TOKEN && parent(n)==actor) { good_ones++; last=n; } if (context==MULTI_TOKEN && ultimate==ScopeCeiling(actor) && n~=actor && n hasnt concealed && n hasnt scenery) { good_ones++; last=n; } if (context==MULTIHELD_TOKEN && parent(n)==actor) { good_ones++; last=n; } if (context==MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { if (advance_warning==-1) { if (context==MULTIEXCEPT_TOKEN) { good_ones++; last=n; } if (context==MULTIINSIDE_TOKEN) { if (parent(n)~=actor) { good_ones++; last=n; } } } else { if (context==MULTIEXCEPT_TOKEN && n~=advance_warning) { good_ones++; last=n; } if (context==MULTIINSIDE_TOKEN && n in advance_warning) { good_ones++; last=n; } } } if (context==CREATURE_TOKEN && CreatureTest(n)==1) { good_ones++; last=n; } match_scores-->i = 1000*(good_ones - match_scores-->i); } if (good_ones == 1) return last; ! If there is ambiguity about what was typed, but it definitely wasn't ! animate as required, then return anything; higher up in the parser ! a suitable error will be given. (This prevents a question being asked.) if (context == CREATURE_TOKEN && good_ones == 0) return match_list-->0; if (indef_mode == 0) indef_type=0; ScoreMatchL(context); if (number_matched == 0) return -1; if (indef_mode == 0) { ! Is there now a single highest-scoring object? i = SingleBestGuess(); if (i >= 0) { #Ifdef DEBUG; if (parser_trace >= 4) print " Single best-scoring object returned.]^"; #Endif; ! DEBUG return i; } } if (indef_mode == 1 && indef_type & PLURAL_BIT ~= 0) { if (context ~= MULTI_TOKEN or MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { etype = MULTI_PE; return -1; } i = 0; offset = multiple_object-->0; for (j=BestGuess(): j~=-1 && i(i+offset) = j; #Ifdef DEBUG; if (parser_trace >= 4) print " Accepting it^"; #Endif; ! DEBUG } else { i = i; #Ifdef DEBUG; if (parser_trace >= 4) print " Rejecting it^"; #Endif; ! DEBUG } } if (i < indef_wanted && indef_wanted < INDEF_ALL_WANTED) { etype = TOOFEW_PE; multi_wanted = indef_wanted; multi_had=i; return -1; } multiple_object-->0 = i+offset; multi_context = context; #Ifdef DEBUG; if (parser_trace >= 4) print " Made multiple object of size ", i, "]^"; #Endif; ! DEBUG return 1; } for (i=0 : ii = 0; n = 1; for (i=0 : ii == 0) { match_classes-->i = n++; flag = 0; for (j=i+1 : jj == 0 && Identical(match_list-->i, match_list-->j) == 1) { flag=1; match_classes-->j = match_classes-->i; } if (flag == 1) match_classes-->i = 1-n; } n--; number_of_classes = n; #Ifdef DEBUG; if (parser_trace >= 4) { print " Grouped into ", n, " possibilities by name:^"; for (i=0 : ii > 0) print " ", (The) match_list-->i, " (", match_list-->i, ") --- group ", match_classes-->i, "^"; } #Endif; ! DEBUG if (indef_mode == 0) { if (n > 1) { k = -1; for (i=0 : ii > k) { k = match_scores-->i; j = match_classes-->i; j = j*j; flag = 0; } else if (match_scores-->i == k) { if ((match_classes-->i) * (match_classes-->i) ~= j) flag = 1; } } if (flag) { #Ifdef DEBUG; if (parser_trace >= 4) print " Unable to choose best group, so ask player.]^"; #Endif; ! DEBUG return 0; } #Ifdef DEBUG; if (parser_trace >= 4) print " Best choices are all from the same group.^"; #Endif; ! DEBUG } } ! When the player is really vague, or there's a single collection of ! indistinguishable objects to choose from, choose the one the player ! most recently acquired, or if the player has none of them, then ! the one most recently put where it is. if (n == 1) dont_infer = true; return BestGuess(); ]; ! Adjudicate [ ReviseMulti second_p i low; #Ifdef DEBUG; if (parser_trace >= 4) print " Revising multiple object list of size ", multiple_object-->0, " with 2nd ", (name) second_p, "^"; #Endif; ! DEBUG if (multi_context == MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { for (i=1,low=0 : i<=multiple_object-->0 : i++) { if ( (multi_context==MULTIEXCEPT_TOKEN && multiple_object-->i ~= second_p) || (multi_context==MULTIINSIDE_TOKEN && multiple_object-->i in second_p)) { low++; multiple_object-->low = multiple_object-->i; } } multiple_object-->0 = low; } if (multi_context == MULTI_TOKEN && action_to_be == ##Take) { #Ifdef DEBUG; if (parser_trace >= 4) print " Token 2 plural case: number with actor ", low, "^"; #Endif; ! DEBUG if (take_all_rule == 2) { for (i=1,low=0 : i<=multiple_object-->0 : i++) { if (ScopeCeiling(multiple_object-->i) == ScopeCeiling(actor)) { low++; multiple_object-->low = multiple_object-->i; } } multiple_object-->0 = low; } } i = multiple_object-->0; #Ifdef DEBUG; if (parser_trace >= 4) print " Done: new size ", i, "^"; #Endif; ! DEBUG if (i == 0) return NOTHING_PE; return 0; ]; [ MakeMatch obj quality i; #Ifdef DEBUG; if (parser_trace >= 6) print " Match with quality ",quality,"^"; #Endif; ! DEBUG if (token_filter ~= 0 && ConsultNounFilterToken(obj) == 0) { #Ifdef DEBUG; if (parser_trace >= 6) print " Match filtered out: token filter ", token_filter, "^"; #Endif; ! DEBUG rtrue; } if (quality < match_length) rtrue; if (quality > match_length) { match_length = quality; number_matched = 0; } else { if (number_matched >= MATCH_LIST_WORDS) rtrue; for (i=0 : ii == obj) rtrue; } match_list-->number_matched++ = obj; #Ifdef DEBUG; if (parser_trace >= 6) print " Match added to list^"; #Endif; ! DEBUG ]; [ ConsultNounFilterToken obj; if (token_filter ofclass Routine) { noun = obj; return indirect(token_filter); } if (obj has (token_filter-1)) rtrue; rfalse; ]; Constant SCORE__CHOOSEOBJ = 1000; Constant SCORE__IFGOOD = 500; Constant SCORE__UNCONCEALED = 100; Constant SCORE__BESTLOC = 60; Constant SCORE__NEXTBESTLOC = 40; Constant SCORE__NOTCOMPASS = 20; Constant SCORE__NOTSCENERY = 10; Constant SCORE__NOTACTOR = 5; Constant SCORE__GNA = 1; Constant SCORE__DIVISOR = 20; Constant PREFER_HELD; [ ScoreMatchL context its_owner its_score obj i j threshold met a_s l_s; ! if (indef_type & OTHER_BIT ~= 0) threshold++; if (indef_type & MY_BIT ~= 0) threshold++; if (indef_type & THAT_BIT ~= 0) threshold++; if (indef_type & LIT_BIT ~= 0) threshold++; if (indef_type & UNLIT_BIT ~= 0) threshold++; if (indef_owner ~= nothing) threshold++; #Ifdef DEBUG; if (parser_trace >= 4) print " Scoring match list: indef mode ", indef_mode, " type ", indef_type, ", satisfying ", threshold, " requirements:^"; #Endif; ! DEBUG #ifdef PREFER_HELD; a_s = SCORE__BESTLOC; l_s = SCORE__NEXTBESTLOC; if (action_to_be == ##Take or ##Remove) { a_s = SCORE__NEXTBESTLOC; l_s = SCORE__BESTLOC; } context = context; ! silence warning #ifnot; a_s = SCORE__NEXTBESTLOC; l_s = SCORE__BESTLOC; if (context == HELD_TOKEN or MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN) { a_s = SCORE__BESTLOC; l_s = SCORE__NEXTBESTLOC; } #endif; ! PREFER_HELD for (i=0 : ii; its_owner = parent(obj); its_score=0; met=0; ! if (indef_type & OTHER_BIT ~= 0 ! && obj ~= itobj or himobj or herobj) met++; if (indef_type & MY_BIT ~= 0 && its_owner == actor) met++; if (indef_type & THAT_BIT ~= 0 && its_owner == actors_location) met++; if (indef_type & LIT_BIT ~= 0 && obj has light) met++; if (indef_type & UNLIT_BIT ~= 0 && obj hasnt light) met++; if (indef_owner ~= 0 && its_owner == indef_owner) met++; if (met < threshold) { #Ifdef DEBUG; if (parser_trace >= 4) print " ", (The) match_list-->i, " (", match_list-->i, ") in ", (the) its_owner, " is rejected (doesn't match descriptors)^"; #Endif; ! DEBUG match_list-->i = -1; } else { its_score = 0; if (obj hasnt concealed) its_score = SCORE__UNCONCEALED; if (its_owner == actor) its_score = its_score + a_s; else if (its_owner == actors_location) its_score = its_score + l_s; else if (its_owner ~= compass) its_score = its_score + SCORE__NOTCOMPASS; its_score = its_score + SCORE__CHOOSEOBJ * ChooseObjects(obj, 2); if (obj hasnt scenery) its_score = its_score + SCORE__NOTSCENERY; if (obj ~= actor) its_score = its_score + SCORE__NOTACTOR; ! A small bonus for having the correct GNA, ! for sorting out ambiguous articles and the like. if (indef_cases & (PowersOfTwo_TB-->(GetGNAOfObject(obj)))) its_score = its_score + SCORE__GNA; match_scores-->i = match_scores-->i + its_score; #Ifdef DEBUG; if (parser_trace >= 4) print " ", (The) match_list-->i, " (", match_list-->i, ") in ", (the) its_owner, " : ", match_scores-->i, " points^"; #Endif; ! DEBUG } } for (i=0 : ii == -1) { if (i == number_matched-1) { number_matched--; break; } for (j=i : jj = match_list-->(j+1); match_scores-->j = match_scores-->(j+1); } number_matched--; } } ]; [ BestGuess earliest its_score best i; earliest = 0; best = -1; for (i=0 : ii >= 0) { its_score = match_scores-->i; if (its_score > best) { best = its_score; earliest = i; } } } #Ifdef DEBUG; if (parser_trace >= 4) if (best < 0) print " Best guess ran out of choices^"; else print " Best guess ", (the) match_list-->earliest, " (", match_list-->earliest, ")^"; #Endif; ! DEBUG if (best < 0) return -1; i = match_list-->earliest; match_list-->earliest = -1; return i; ]; [ SingleBestGuess earliest its_score best i; earliest = -1; best = -1000; for (i=0 : ii; if (its_score == best) earliest = -1; if (its_score > best) { best = its_score; earliest = match_list-->i; } } return earliest; ]; [ Identical o1 o2 p1 p2 n1 n2 i j flag; if (o1 == o2) rtrue; ! This should never happen, but to be on the safe side if (o1 == 0 || o2 == 0) rfalse; ! Similarly if (o1 ofclass K3_direction || o2 ofclass K3_direction) rfalse; ! Saves time ! What complicates things is that o1 or o2 might have a parsing routine, ! so the parser can't know from here whether they are or aren't the same. ! If they have different parsing routines, we simply assume they're ! different. If they have the same routine (which they probably got from ! a class definition) then the decision process is as follows: ! ! the routine is called (with self being o1, not that it matters) ! with noun and second being set to o1 and o2, and action being set ! to the fake action TheSame. If it returns -1, they are found ! identical; if -2, different; and if >=0, then the usual method ! is used instead. if (o1.parse_name ~= 0 || o2.parse_name ~= 0) { if (o1.parse_name ~= o2.parse_name) rfalse; parser_action = ##TheSame; parser_one = o1; parser_two = o2; j = wn; i = RunRoutines(o1,parse_name); wn = j; if (i == -1) rtrue; if (i == -2) rfalse; } ! This is the default algorithm: do they have the same words in their ! "name" (i.e. property no. 1) properties. (Note that the following allows ! for repeated words and words in different orders.) p1 = o1.&1; n1 = (o1.#1)/WORDSIZE; p2 = o2.&1; n2 = (o2.#1)/WORDSIZE; ! for (i=0 : ii, " "; } new_line; ! for (i=0 : ii, " "; } new_line; for (i=0 : ii == p2-->j) flag = 1; if (flag == 0) rfalse; } for (j=0 : ji == p2-->j) flag = 1; if (flag == 0) rfalse; } ! print "Which are identical!^"; rtrue; ]; [ PrintInferredCommand from singleton_noun; singleton_noun = FALSE; if ((from ~= 0) && (from == pcount-1) && (pattern-->from > 1) && (pattern-->from < REPARSE_CODE)) singleton_noun = TRUE; if (singleton_noun) { BeginActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from); if (ForActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from) == 0) { print "("; PrintCommand(from); print ")^"; } EndActivity(CLARIFYING_PARSERS_CHOICE_ACT, pattern-->from); } else { print "("; PrintCommand(from); print ")^"; } ]; [ PrintCommand from i k spacing_flag; if (from == 0) { i = verb_word; if (LanguageVerb(i) == 0) if (PrintVerb(i) == 0) print (address) i; from++; spacing_flag = true; } for (k=from : kk; if (i == PATTERN_NULL) continue; if (spacing_flag) print (char) ' '; if (i == 0) { print (string) THOSET__TX; jump TokenPrinted; } if (i == 1) { print (string) THAT__TX; jump TokenPrinted; } if (i >= REPARSE_CODE) print (address) VM_NumberToDictionaryAddress(i-REPARSE_CODE); else if (i ofclass K3_direction) print (LanguageDirection) i; ! the direction name as adverb else print (the) i; .TokenPrinted; spacing_flag = true; } ]; [ CantSee i w e; saved_oops=oops_from; if (scope_token ~= 0) { scope_error = scope_token; return ASKSCOPE_PE; } wn--; w = NextWord(); e = CANTSEE_PE; if (w == pronoun_word) { pronoun__word = pronoun_word; pronoun__obj = pronoun_obj; e = ITGONE_PE; } if (etype > e) return etype; return e; ]; [ MultiAdd o i j; i = multiple_object-->0; if (i == MATCH_LIST_WORDS-1) { toomany_flag = 1; rtrue; } for (j=1 : j<=i : j++) if (o == multiple_object-->j) rtrue; i++; multiple_object-->i = o; multiple_object-->0 = i; ]; [ MultiSub o i j k; i = multiple_object-->0; for (j=1 : j<=i : j++) if (o == multiple_object-->j) { for (k=j : k<=i : k++) multiple_object-->k = multiple_object-->(k+1); multiple_object-->0 = --i; return 0; } return VAGUE_PE; ]; [ MultiFilter attr i j o; .MFiltl; i = multiple_object-->0; for (j=1 : j<=i : j++) { o = multiple_object-->j; if (o hasnt attr) { MultiSub(o); jump Mfiltl; } } ]; [ PlaceInScope O opts; ! If opts is set, do not place contents in scope wn = match_from; if (opts == false) DoScopeActionAndRecurse(O); else DoScopeAction(O); return; ]; [ AddToScope obj; if (ats_flag >= 2) DoScopeActionAndRecurse(obj, 0, ats_flag-2); if (ats_flag == 1) { if (HasLightSource(obj)==1) ats_hls = 1; } ]; [ TestScope obj act a al sr x y; x = parser_one; y = parser_two; parser_one = obj; parser_two = 0; a = actor; al = actors_location; sr = scope_reason; scope_reason = TESTSCOPE_REASON; if (act == 0) actor = player; else actor = act; actors_location = ScopeCeiling(actor); SearchScope(actors_location, actor, 0); scope_reason = sr; actor = a; actors_location = al; parser_one = x; x = parser_two; parser_two = y; return x; ]; [ LoopOverScope routine act x y a al; x = parser_one; y = scope_reason; a = actor; al = actors_location; parser_one = routine; if (act == 0) actor = player; else actor = act; actors_location = ScopeCeiling(actor); scope_reason = LOOPOVERSCOPE_REASON; SearchScope(actors_location, actor, 0); parser_one = x; scope_reason = y; actor = a; actors_location = al; ]; [ SearchScope domain1 domain2 context i; if (domain1 == 0) return; ! (a) if (scope_token) { scope_stage = 2; #Ifdef DEBUG; if (parser_trace >= 3) print " [Scope routine called at stage 2]^"; #Endif; if (indirect(scope_token) ~= 0) rtrue; } ! (b) BeginActivity(DECIDING_SCOPE_ACT, actor); if (ForActivity(DECIDING_SCOPE_ACT, actor) == false) { ! (c.1) if ((scope_reason == PARSING_REASON) && (context == MULTIINSIDE_TOKEN) && (advance_warning ~= -1)) { if (IsSeeThrough(advance_warning) == 1) ScopeWithin(advance_warning, 0, context); } else { ! (c.2) if ((scope_reason == PARSING_REASON) && (context ~= CREATURE_TOKEN) && (indef_mode == 0) && (domain1 == actors_location)) ScopeWithin(compass); ! (c.3) if (domain1 has supporter or container) DoScopeAction(domain1); ScopeWithin(domain1, domain2, context); ! (c.4) if (domain2) { if (domain2 has supporter or container) DoScopeAction(domain2); ScopeWithin(domain2, 0, context); } } ! (c.5) if (thedark == domain1 or domain2) { DoScopeActionAndRecurse(actor, actor, context); if (parent(actor) has supporter or container) DoScopeActionAndRecurse(parent(actor), parent(actor), context); } } EndActivity(DECIDING_SCOPE_ACT, actor); ]; [ ScopeWithin domain nosearch context obj next_obj; if (domain == 0) rtrue; ! Look through the objects in the domain, avoiding "objectloop" in case ! movements occur. obj = child(domain); while (obj) { next_obj = sibling(obj); if ((domain == actor) || (TestConcealment(domain, obj) == false)) DoScopeActionAndRecurse(obj, nosearch, context); obj = next_obj; } ]; [ DoScopeActionAndRecurse domain nosearch context i ad n obj next_obj; DoScopeAction(domain); ! (a) if ((domain ~= nosearch) && ((domain ofclass K1_room or K8_person) || (IsSeeThrough(domain) == 1))) { obj = child(domain); while (obj) { next_obj = sibling(obj); if ((domain == actor) || (TestConcealment(domain, obj) == false)) DoScopeActionAndRecurse(obj, nosearch, context); obj = next_obj; } } ! (b) if (domain provides component_child) { obj = domain.component_child; while (obj) { next_obj = obj.component_sibling; if ((domain == actor) || (TestConcealment(domain, obj) == false)) DoScopeActionAndRecurse(obj, 0, context); obj = next_obj; } } ! (c) ad = domain.&add_to_scope; if (ad ~= 0) { ! Test if the property value is not an object. #Ifdef TARGET_ZCODE; i = (UnsignedCompare(ad-->0, top_object) > 0); #Ifnot; ! TARGET_GLULX i = (((ad-->0)->0) ~= $70); #Endif; ! TARGET_ if (i) { ats_flag = 2+context; RunRoutines(domain, add_to_scope); ats_flag = 0; } else { n = domain.#add_to_scope; for (i=0 : (WORDSIZE*i)i) DoScopeActionAndRecurse(ad-->i, 0, context); } } ]; [ DoScopeAction item; #Ifdef DEBUG; if (parser_trace >= 6) print "[DSA on ", (the) item, " with reason = ", scope_reason, " p1 = ", parser_one, " p2 = ", parser_two, "]^"; #Endif; ! DEBUG @push parser_one; @push scope_reason; switch(scope_reason) { TESTSCOPE_REASON: if (item == parser_one) parser_two = 1; LOOPOVERSCOPE_REASON: if (parser_one ofclass Routine) indirect(parser_one, item); PARSING_REASON, TALKING_REASON: MatchTextAgainstObject(item); } @pull scope_reason; @pull parser_one; ]; [ MatchTextAgainstObject item i; if (match_from <= num_words) { ! If there's any text to match, that is wn = match_from; i = NounWord(); if ((i == 1) && (player == item)) MakeMatch(item, 1); ! "me" if ((i >= 2) && (i < 128) && (LanguagePronouns-->i == item)) MakeMatch(item, 1); } ! Construing the current word as the start of a noun, can it refer to the ! object? wn = match_from; if (TryGivenObject(item) > 0) if (indef_nspec_at > 0 && match_from ~= indef_nspec_at) { ! This case arises if the player has typed a number in ! which is hypothetically an indefinite descriptor: ! e.g. "take two clubs". We have just checked the object ! against the word "clubs", in the hope of eventually finding ! two such objects. But we also backtrack and check it ! against the words "two clubs", in case it turns out to ! be the 2 of Clubs from a pack of cards, say. If it does ! match against "two clubs", we tear up our original ! assumption about the meaning of "two" and lapse back into ! definite mode. wn = indef_nspec_at; if (TryGivenObject(item) > 0) { match_from = indef_nspec_at; ResetDescriptors(); } wn = match_from; } ]; [ TryGivenObject obj nomatch threshold k w j; #Ifdef DEBUG; if (parser_trace >= 5) print " Trying ", (the) obj, " (", obj, ") at word ", wn, "^"; #Endif; ! DEBUG if (nomatch && obj == 0) return 0; ! if (nomatch) print "*** TryGivenObject *** on ", (the) obj, " at wn = ", wn, "^"; dict_flags_of_noun = 0; ! If input has run out then always match, with only quality 0 (this saves ! time). if (wn > num_words) { if (nomatch) return 0; if (indef_mode ~= 0) dict_flags_of_noun = $$01110000; ! Reject "plural" bit MakeMatch(obj,0); #Ifdef DEBUG; if (parser_trace >= 5) print " Matched (0)^"; #Endif; ! DEBUG return 1; } ! Ask the object to parse itself if necessary, sitting up and taking notice ! if it says the plural was used: if (obj.parse_name~=0) { parser_action = NULL; j=wn; k = RunRoutines(obj,parse_name); if (k > 0) { wn=j+k; .MMbyPN; if (parser_action == ##PluralFound) dict_flags_of_noun = dict_flags_of_noun | 4; if (dict_flags_of_noun & 4) { if (~~allow_plurals) k = 0; else { if (indef_mode == 0) { indef_mode = 1; indef_type = 0; indef_wanted = 0; } indef_type = indef_type | PLURAL_BIT; if (indef_wanted == 0) indef_wanted = INDEF_ALL_WANTED; } } #Ifdef DEBUG; if (parser_trace >= 5) print " Matched (", k, ")^"; #Endif; ! DEBUG if (nomatch == false) MakeMatch(obj,k); return k; } if (k == 0) jump NoWordsMatch; } ! The default algorithm is simply to count up how many words pass the ! Refers test: parser_action = NULL; w = NounWord(); if (w == 1 && player == obj) { k=1; jump MMbyPN; } if (w >= 2 && w < 128 && (LanguagePronouns-->w == obj)) { k = 1; jump MMbyPN; } if (Refers(obj, wn-1) == 0) { .NoWordsMatch; if (indef_mode ~= 0) { k = 0; parser_action = NULL; jump MMbyPN; } rfalse; } threshold = 1; dict_flags_of_noun = (w->#dict_par1) & $$01110100; w = NextWord(); while (Refers(obj, wn-1)) { threshold++; if (w) dict_flags_of_noun = dict_flags_of_noun | ((w->#dict_par1) & $$01110100); w = NextWord(); } k = threshold; jump MMbyPN; ]; [ Refers obj wnum wd k l m; if (obj == 0) rfalse; #Ifdef LanguageRefers; k = LanguageRefers(obj,wnum); if (k >= 0) return k; #Endif; ! LanguageRefers k = wn; wn = wnum; wd = NextWordStopped(); wn = k; if (parser_inflection >= 256) { k = indirect(parser_inflection, obj, wd); if (k >= 0) return k; m = -k; } else m = parser_inflection; k = obj.&m; l = (obj.#m)/WORDSIZE-1; for (m=0 : m<=l : m++) if (wd == k-->m) rtrue; rfalse; ]; [ WordInProperty wd obj prop k l m; k = obj.∝ l = (obj.#prop)/WORDSIZE-1; for (m=0 : m<=l : m++) if (wd == k-->m) rtrue; rfalse; ]; [ NounWord i j s; i = NextWord(); if (i == 0) rfalse; if (i == ME1__WD or ME2__WD or ME3__WD) return 1; s = LanguagePronouns-->0; for (j=1 : j<=s : j=j+3) if (i == LanguagePronouns-->j) return j+2; if ((i->#dict_par1)&128 == 0) rfalse; return i; ]; [ TryNumber wordnum i j c num len mul tot d digit; i = wn; wn = wordnum; j = NextWord(); wn = i; j = NumberWord(j); ! Test for verbal forms ONE to TWENTY if (j >= 1) return j; #Ifdef TARGET_ZCODE; i = wordnum*4+1; j = parse->i; num = j+buffer; len = parse->(i-1); #Ifnot; ! TARGET_GLULX i = wordnum*3; j = parse-->i; num = j+buffer; len = parse-->(i-1); #Endif; ! TARGET_ if (len >= 4) mul=1000; if (len == 3) mul=100; if (len == 2) mul=10; if (len == 1) mul=1; tot = 0; c = 0; len = len-1; for (c=0 : c<=len : c++) { digit=num->c; if (digit == '0') { d = 0; jump digok; } if (digit == '1') { d = 1; jump digok; } if (digit == '2') { d = 2; jump digok; } if (digit == '3') { d = 3; jump digok; } if (digit == '4') { d = 4; jump digok; } if (digit == '5') { d = 5; jump digok; } if (digit == '6') { d = 6; jump digok; } if (digit == '7') { d = 7; jump digok; } if (digit == '8') { d = 8; jump digok; } if (digit == '9') { d = 9; jump digok; } return -1000; .digok; tot = tot+mul*d; mul = mul/10; } if (len > 3) tot=10000; return tot; ]; [ I7_ExtendedTryNumber wordnum i j; i = wn; wn = wordnum; j = NextWordStopped(); wn = i; switch (j) { 'twenty-one': return 21; 'twenty-two': return 22; 'twenty-three': return 23; 'twenty-four': return 24; 'twenty-five': return 25; 'twenty-six': return 26; 'twenty-seven': return 27; 'twenty-eight': return 28; 'twenty-nine': return 29; 'thirty': return 30; default: return TryNumber(wordnum); } ]; [ GetGender person; if (person hasnt female) rtrue; rfalse; ]; [ GetGNAOfObject obj case gender; if (obj hasnt animate) case = 6; if (obj has male) gender = male; if (obj has female) gender = female; if (obj has neuter) gender = neuter; if (gender == 0) { if (case == 0) gender = LanguageAnimateGender; else gender = LanguageInanimateGender; } if (gender == female) case = case + 1; if (gender == neuter) case = case + 2; if (obj has pluralname) case = case + 3; return case; ]; [ DetectPluralWord at n i w swn outcome; swn = wn; wn = at; for (i=0:i#dict_par1) & $$00000100) { parser_action = ##PluralFound; outcome = true; } } wn = swn; return outcome; ]; [ SetPronoun dword value x; for (x=1 : x<=LanguagePronouns-->0 : x=x+3) if (LanguagePronouns-->x == dword) { LanguagePronouns-->(x+2) = value; return; } RunTimeError(14); ]; [ PronounValue dword x; for (x=1 : x<=LanguagePronouns-->0 : x=x+3) if (LanguagePronouns-->x == dword) return LanguagePronouns-->(x+2); return 0; ]; [ ResetVagueWords obj; PronounNotice(obj); ]; [ PronounNotice obj x bm; if (obj == player) return; bm = PowersOfTwo_TB-->(GetGNAOfObject(obj)); for (x=1 : x<=LanguagePronouns-->0 : x=x+3) if (bm & (LanguagePronouns-->(x+1)) ~= 0) LanguagePronouns-->(x+2) = obj; ]; [ PronounNoticeHeldObjects x; #IFNDEF MANUAL_PRONOUNS; objectloop(x in player) PronounNotice(x); #ENDIF; x = 0; ! To prevent a "not used" error rfalse; ]; [ YesOrNo i j; for (::) { #Ifdef TARGET_ZCODE; if (location == nothing || parent(player) == nothing) read buffer parse; else read buffer parse DrawStatusLine; j = parse->1; #Ifnot; ! TARGET_GLULX; KeyboardPrimitive(buffer, parse); j = parse-->0; #Endif; ! TARGET_ if (j) { ! at least one word entered i = parse-->1; if (i == YES1__WD or YES2__WD or YES3__WD) rtrue; if (i == NO1__WD or NO2__WD or NO3__WD) rfalse; } L__M(##Quit, 1); print "> "; } ]; [ NumberWord o i n; n = LanguageNumbers-->0; for (i=1 : i<=n : i=i+2) if (o == LanguageNumbers-->i) return LanguageNumbers-->(i+1); return 0; ]; !Constant COBJ_DEBUG; ! the highest value returned by CheckDPMR (see the Standard Rules) Constant HIGHEST_DPMR_SCORE = 4; Array alt_match_list --> (MATCH_LIST_WORDS+1); #ifdef TARGET_GLULX; [ COBJ__Copy words from to i; for (i=0: ii = from-->i; ]; #ifnot; [ COBJ__Copy words from to bytes; bytes = words * 2; @copy_table from to bytes; ]; #endif; ! swap alt_match_list with match_list/number_matched [ COBJ__SwapMatches i x; ! swap the counts x = number_matched; number_matched = alt_match_list-->0; alt_match_list-->0 = x; ! swap the values if (x < number_matched) x = number_matched; for (i=x: i>0: i--) { x = match_list-->(i-1); match_list-->(i-1) = alt_match_list-->i; alt_match_list-->i = x; } ]; [ ChooseObjects obj code l i swn spcount; if (code<2) rfalse; if (cobj_flag == 1) { .CodeOne; if (parameters > 0) { #ifdef COBJ_DEBUG; print "[scoring ", (the) obj, " (second)]^"; #endif; return ScoreDabCombo(parser_results-->2, obj); } else { #ifdef COBJ_DEBUG; print "[scoring ", (the) obj, " (first) in ", alt_match_list-->0, " combinations]^"; #endif; l = 0; for (i=1: i<=alt_match_list-->0: i++) { spcount = ScoreDabCombo(obj, alt_match_list-->i); if (spcount == HIGHEST_DPMR_SCORE) { #ifdef COBJ_DEBUG; print "[scored ", spcount, " - best possible]^"; #endif; return spcount; } if (spcount>l) l = spcount; } return l; } } if (cobj_flag == 2) { .CodeTwo; #ifdef COBJ_DEBUG; print "[scoring ", (the) obj, " (simple); parameters = ", parameters, " aw = ", advance_warning, "]^"; #endif; @push action_to_be; if (parameters==0) { if (advance_warning > 0) l = ScoreDabCombo(obj, advance_warning); else l = ScoreDabCombo(obj, 0); } else { l = ScoreDabCombo(parser_results-->2, obj); } @pull action_to_be; return l; } #ifdef COBJ_DEBUG; print "[choosing a cobj strategy: "; #endif; swn = wn; spcount = pcount; while (line_ttype-->pcount == PREPOSITION_TT) pcount++; if (line_ttype-->pcount == ELEMENTARY_TT) { while (wn <= num_words) { l = NextWordStopped(); wn--; if ( (l ~= -1 or 0) && (l->#dict_par1) &8 ) { wn++; continue; } ! if preposition if (l == ALL1__WD or ALL2__WD or ALL3__WD or ALL4__WD or ALL5__WD) { wn++; continue; } SafeSkipDescriptors(); ! save the current match state @push match_length; @push token_filter; @push match_from; alt_match_list-->0 = number_matched; COBJ__Copy(number_matched, match_list, alt_match_list+WORDSIZE); ! now get all the matches for the second noun match_length = 0; number_matched = 0; match_from = wn; token_filter = 0; SearchScope(actor, actors_location, line_tdata-->pcount); #ifdef COBJ_DEBUG; print number_matched, " possible second nouns]^"; #endif; wn = swn; cobj_flag = 1; ! restore match variables COBJ__SwapMatches(); @pull match_from; @pull token_filter; @pull match_length; pcount = spcount; jump CodeOne; } } pcount = spcount; wn = swn; #ifdef COBJ_DEBUG; print "nothing interesting]^"; #endif; cobj_flag = 2; jump CodeTwo; ]; [ ScoreDabCombo a b result; @push action; @push act_requester; @push noun; @push second; action = action_to_be; act_requester = player; if (action_reversed) { noun = b; second = a; } else { noun = a; second = b; } result = CheckDPMR(); @pull second; @pull noun; @pull act_requester; @pull action; #ifdef COBJ_DEBUG; print "[", (the) a, " / ", (the) b, " => ", result, "]^"; #endif; return result; ]; [ ParserError error_type; if (error_type ofclass String or Routine) PrintSingleParagraph(error_type); rfalse; ]; Object InformLibrary "(Inform Library)" has proper; Array Protect_I7_Arrays --> 16339 12345; Global EarlyInTurnSequence; [ Main; #ifdef TARGET_ZCODE; max_z_object = #largest_object - 255; #endif; ProcessRulebook(STARTUP_RB); #ifdef DEBUG; InternalTestCases(); #endif; while (true) { while (deadflag == false) { EarlyInTurnSequence = true; FollowRulebook(TURN_SEQUENCE_RB); } if (FollowRulebook(SHUTDOWN_RB) == false) return; } ]; [ VIRTUAL_MACHINE_STARTUP_R; ProcessRulebook(Activity_before_rulebooks-->STARTING_VIRTUAL_MACHINE_ACT); ProcessRulebook(Activity_for_rulebooks-->STARTING_VIRTUAL_MACHINE_ACT); ProcessRulebook(Activity_after_rulebooks-->STARTING_VIRTUAL_MACHINE_ACT); VM_Initialise(); print "^^^"; rfalse; ]; Constant PLAYER_OBJECT_INIS = 0; Constant START_OBJECT_INIS = 1; Constant START_ROOM_INIS = 2; Constant START_TIME_INIS = 3; Array InitialSituation --> selfobj nothing O37_your_room 540 ; [ INITIALISE_MEMORY_R; #Ifdef LanguageInitialise; LanguageInitialise(); #Endif; not_yet_in_play = true; #ifdef I7_LOOKMODE; lookmode = I7_LOOKMODE; #endif; player = InitialSituation-->PLAYER_OBJECT_INIS; the_time = InitialSituation-->START_TIME_INIS; real_location = nothing; location = nothing; CreatePropertyOffsets(); HeapInitialise(); ! Create a completely unused memory allocation heap InitialHeapAllocation(); ! Allocate empty blocks for variables, properties, and such CreateBlockConstants(); ! Allocate and fill in blocks for constant values DistributeBlockConstants(); ! Ensure these exist in multiple independent copies when needed rfalse; ]; [ SEED_RANDOM_NUMBER_GENERATOR_R i; if (0) VM_Seed_RNG(0); for (i=1: i<=100: i++) random(i); rfalse; ]; [ POSITION_PLAYER_IN_MODEL_R player_to_be; player = selfobj; player_to_be = InitialSituation-->PLAYER_OBJECT_INIS; location = LocationOf(player_to_be); if (location == 0) { location = InitialSituation-->START_ROOM_INIS; if (InitialSituation-->START_OBJECT_INIS) move player_to_be to InitialSituation-->START_OBJECT_INIS; else move player_to_be to location; } if (player_to_be ~= player) { remove selfobj; ChangePlayer(player_to_be); } real_location = location; SilentlyConsiderLight(); NOTE_OBJECT_ACQUISITIONS_R(); MoveFloatingObjects(); actor = player; act_requester = nothing; actors_location = real_location; action = ##Wait; rfalse; ]; Constant ACTION_PRES = 0; Constant NO_INPS_PRES = 1; Constant INP1_PRES = 2; Constant INP2_PRES = 3; [ PARSE_COMMAND_R; if (EarlyInTurnSequence == false) rfalse; ! Prevent use outside top level not_yet_in_play = false; Parser__parse(parser_results); TreatParserResults(parser_results); rfalse; ]; [ TreatParserResults results; if (results-->ACTION_PRES == ##MistakeAction) meta = true; if (results-->ACTION_PRES == ##Tell && results-->INP1_PRES == player && actor ~= player) { results-->ACTION_PRES = ##Ask; results-->INP1_PRES = actor; actor = player; } ]; [ GENERATE_ACTION_R i j k l; if (EarlyInTurnSequence == false) rfalse; ! Prevent use outside top level EarlyInTurnSequence = false; action = parser_results-->ACTION_PRES; act_requester = nothing; if (actor ~= player) act_requester = player; inp1 = 0; inp2 = 0; multiflag = false; if (parser_results-->NO_INPS_PRES >= 1) { inp1 = parser_results-->INP1_PRES; if (inp1 == 0) multiflag = true; } if (parser_results-->NO_INPS_PRES >= 2) { inp2 = parser_results-->INP2_PRES; if (inp2 == 0) multiflag = true; } if (inp1 == 1) { noun = special_number1; } else noun = inp1; if (inp2 == 1) { if (inp1 == 1) second = special_number2; else second = special_number1; } else second = inp2; if (multiflag) { if (multiple_object-->0 == 0) { L__M(##Miscellany, 2); return; } if (toomany_flag) { toomany_flag = false; L__M(##Miscellany, 1); } GenerateMultipleActions(); multiflag = false; } else BeginAction(action, noun, second); if ((actor ~= player) || (act_requester)) action = ##Wait; actor = player; act_requester = 0; if (meta) { RulebookSucceeds(); rtrue; } rfalse; ]; [ GenerateMultipleActions initial_location k item; initial_location = location; for (k=1: k<=multiple_object-->0: k++) { item = multiple_object-->k; RunParagraphOn(); if (inp1 == 0) { inp1 = item; BeginAction(action, item, second, item); inp1 = 0; } else { inp2 = item; BeginAction(action, noun, item, item); inp2 = 0; } if (deadflag) return; if (location ~= initial_location) { L__M(##Miscellany, 51); return; } } ]; [ TIMED_EVENTS_R i event_timer fire rule; for (i=1: i<=(TimedEventsTable-->0): i++) if ((rule=TimedEventsTable-->i) ~= 0) { event_timer = TimedEventTimesTable-->i; fire = false; if (event_timer<0) { (TimedEventTimesTable-->i)++; if (TimedEventTimesTable-->i == 0) fire = true; } else { if ((the_time >= event_timer) && (the_time < event_timer+30)) fire = true; } if (fire) { TimedEventsTable-->i = 0; ProcessRulebook(rule); } } rfalse; ]; [ SetTimedEvent rule event_time absolute_time i b; for (i=1: i<=(TimedEventsTable-->0): i++) { if (rule == TimedEventsTable-->i) { b=i; break; } if ((b==0) && (TimedEventsTable-->i == 0)) b=i; } if (b==0) return RunTimeProblem(RTP_TOOMANYEVENTS); TimedEventsTable-->b = rule; if (absolute_time) TimedEventTimesTable-->b = event_time; else TimedEventTimesTable-->b = -event_time; ]; Global time_step; [ SetTime t s; the_time = t; time_rate = s; time_step = 0; if (s < 0) time_step = 0-s; ]; [ ADVANCE_TIME_R; turns++; if (the_time ~= NULL) { if (time_rate >= 0) the_time = the_time+time_rate; else { time_step--; if (time_step == 0) { the_time++; time_step = -time_rate; } } the_time = the_time % TWENTY_FOUR_HOURS; } rfalse; ]; [ NOTE_OBJECT_ACQUISITIONS_R obj; objectloop (obj in player) give obj moved ~concealed; #Ifdef RUCKSACK_CLASS; objectloop (obj in player) if (obj ofclass RUCKSACK_CLASS) SACK_OBJECT = obj; objectloop (obj ofclass RUCKSACK_CLASS && obj provides component_parent && obj.component_parent == player) SACK_OBJECT = obj; #Endif; rfalse; ]; [ RESURRECT_PLAYER_IF_ASKED_R; if (resurrect_please) { RulebookSucceeds(); resurrect_please = false; deadflag = 0; rtrue; } rfalse; ]; [ ASK_FINAL_QUESTION_R; print "^"; while (true) { CarryOutActivity(DEALING_WITH_FINAL_QUESTION_ACT); DivideParagraphPoint(); } ]; [ READ_FINAL_ANSWER_R; DrawStatusLine(); KeyboardPrimitive(buffer, parse); players_command = 100 + WordCount(); num_words = WordCount(); wn = 1; rfalse; ]; [ IMMEDIATELY_RESTART_VM_R; @restart; ]; [ IMMEDIATELY_RESTORE_SAVED_R; actor = player; RESTORE_THE_GAME_R(); ]; [ IMMEDIATELY_QUIT_R; @quit; ]; [ IMMEDIATELY_UNDO_R; if (not_yet_in_play == false) turns++; Perform_Undo(); if (not_yet_in_play == false) turns--; ]; [ PRINT_OBITUARY_HEADLINE_R; print "^^ "; VM_Style(ALERT_VMSTY); print "***"; if (deadflag == 1) L__M(##Miscellany, 3); if (deadflag == 2) L__M(##Miscellany, 4); if (deadflag ~= 0 or 1 or 2) { print " "; if (deadflag ofclass Routine) (deadflag)(); if (deadflag ofclass String) print (string) deadflag; print " "; } print "***"; VM_Style(NORMAL_VMSTY); print "^^"; #Ifndef NO_SCORE; print "^"; #Endif; rfalse; ]; [ PRINT_FINAL_SCORE_R; #Ifndef NO_SCORING; ANNOUNCE_SCORE_R(); #Endif; rfalse; ]; [ DISPLAY_FINAL_STATUS_LINE_R; sline1 = score; sline2 = turns; rfalse; ]; Attribute p69_recurring; Attribute p72_ambiguously_plural; Attribute p78_readied; Attribute p80_at_parry; Attribute p82_at_dodge; Array property_metadata --> "description" K1_room K2_thing NULL "printed name" K1_room K2_thing NULL "map region" K1_room NULL "indefinite article" K2_thing NULL "initial appearance" K2_thing NULL "printed plural name" K2_thing NULL "opposite" K3_direction NULL "other side" K4_door NULL "carrying capacity" K5_container K6_supporter K8_person NULL "matching key" K4_door K5_container K2_thing NULL "health" K8_person NULL "permanent health" K8_person NULL "gained health" K8_person NULL "melee" K8_person NULL "defence" K8_person NULL "damage die" K8_person K31_weapon NULL "initiative modifier" K8_person NULL "concentration" K8_person NULL "combat ai rulebook" K8_person NULL "dodgability" K31_weapon NULL "passive parry max" K31_weapon NULL "active parry max" K31_weapon NULL "weapon attack bonus" K31_weapon NULL "maximum shots" K31_weapon NULL "current shots" K31_weapon NULL "maximum load time" K31_weapon NULL "current load time" K31_weapon NULL "privately-named" K1_room K2_thing K3_direction NULL "lighted" K1_room K1_room K2_thing NULL "visited" K1_room NULL "lit" K2_thing K1_room K2_thing NULL "edible" K2_thing NULL "fixed in place" K2_thing NULL "scenery" K2_thing NULL "wearable" K2_thing NULL "pushable between rooms" K2_thing NULL "handled" K2_thing NULL "initially carried" K2_thing NULL "plural-named" K2_thing NULL "proper-named" K2_thing NULL "undescribed" K2_thing NULL "marked for listing" K2_thing K3_direction NULL "mentioned" K2_thing NULL "enterable" K5_container K6_supporter NULL "transparent" K5_container NULL "open" K4_door K5_container NULL "openable" K4_door K5_container NULL "lockable" K4_door K5_container NULL "locked" K4_door K5_container NULL "female" K8_person NULL "neuter" K8_person K2_thing NULL "switched on" K26_device NULL "recurring" 0 NULL "activation relates" NULL "ambiguously plural" K2_thing NULL "hostility" K8_person NULL "pressing relates" NULL "combat state" K8_person NULL "react state" K8_person NULL "readied" K31_weapon NULL "at parry" K8_person NULL "at dodge" K8_person NULL "specification" NULL ; Array attribute_offsets --> (50 + 85); Array property_offsets --> (100 + 85 + INDIV_PROP_START-48); [ CreatePropertyOffsets i; for (i=0: i<135: i++) attribute_offsets-->i = -1; for (i=0: i<185: i++) property_offsets-->i = -1; attribute_offsets-->privately_named = 88; attribute_offsets-->light = 93; attribute_offsets-->visited = 98; attribute_offsets-->light = 101; attribute_offsets-->edible = 106; attribute_offsets-->static = 109; attribute_offsets-->scenery = 112; attribute_offsets-->clothing = 115; attribute_offsets-->pushable = 118; attribute_offsets-->moved = 121; attribute_offsets-->initially_carried = 124; attribute_offsets-->pluralname = 127; attribute_offsets-->proper = 130; attribute_offsets-->concealed = 133; attribute_offsets-->workflag = 136; attribute_offsets-->mentioned = 140; attribute_offsets-->enterable = 143; attribute_offsets-->transparent = 147; attribute_offsets-->open = 150; attribute_offsets-->openable = 154; attribute_offsets-->lockable = 158; attribute_offsets-->locked = 162; attribute_offsets-->female = 166; attribute_offsets-->neuter = 169; attribute_offsets-->on = 173; attribute_offsets-->p69_recurring = 176; attribute_offsets-->p72_ambiguously_plural = 181; attribute_offsets-->p78_readied = 195; attribute_offsets-->p80_at_parry = 198; attribute_offsets-->p82_at_dodge = 201; property_offsets-->description = 0; property_offsets-->short_name = 4; property_offsets-->map_region = 8; property_offsets-->article = 11; property_offsets-->initial = 14; property_offsets-->plural = 17; property_offsets-->p6_opposite = 20; property_offsets-->door_to = 23; property_offsets-->capacity = 26; property_offsets-->with_key = 31; property_offsets-->p10_health = 36; property_offsets-->p11_permanent_health = 39; property_offsets-->p12_gained_health = 42; property_offsets-->p13_melee = 45; property_offsets-->p14_defence = 48; property_offsets-->p15_damage_die = 51; property_offsets-->p16_initiative_modifier = 55; property_offsets-->p17_concentration = 58; property_offsets-->p18_combat_ai_rulebook = 61; property_offsets-->p19_dodgability = 64; property_offsets-->p20_passive_parry_max = 67; property_offsets-->p21_active_parry_max = 70; property_offsets-->p22_weapon_attack_bonus = 73; property_offsets-->p23_maximum_shots = 76; property_offsets-->p24_current_shots = 79; property_offsets-->p25_maximum_load_time = 82; property_offsets-->p26_current_load_time = 85; property_offsets-->p71_activation_relates = 179; property_offsets-->p74_hostility = 184; property_offsets-->p75_pressing_relates = 187; property_offsets-->p76_combat_state = 189; property_offsets-->p77_react_state = 192; property_offsets-->p84_specification = 204; ]; Constant Q41_entire_game = 1; Constant Q50_player_may_exit_upon_zer = 1; Constant Q51_player_may_not_exit = 2; Constant Q53_no_quip_chosen = 1; Constant Q55_quip_on = 1; Constant Q69_neutral = 1; Constant Q70_friendly = 2; Constant Q71_hostile = 3; Constant Q72_hostile_2 = 4; Constant Q73_hostile_3 = 5; Constant Q74_hostile_4 = 6; Constant Q75_none = 1; Constant Q76_acted = 2; Constant Q77_react = 3; Constant Q78_no_react = 1; Constant Q79_defensive = 2; Constant Q80_aggressive = 3; Constant Q99_set_values_1 = 2; Constant Q100_set_values_2 = 3; Constant Q101_set_values_3 = 4; Constant Q102_set_values_4 = 5; Constant Q103_set_values_5 = 6; Constant Q104_set_values_6 = 7; Array Global_Vars --> (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (false ) ! 8: Q7_darkness_witnessed (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (SC_4) ! 23: Q24_command_prompt (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (SC_3) ! 28: Q29_story_author (EMPTY_TEXT_VALUE ) ! 29: Q30_story_headline (EMPTY_TEXT_VALUE ) ! 30: Q31_story_genre (EMPTY_TEXT_VALUE ) ! 31: Q32_story_description (0 ) ! 32: Q33_release_number (0 ) ! 33: Q34_story_creation_year (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0 ) ! 40: Q42_locale_paragraph_count (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (0) ! Skipped (Q50_player_may_exit_upon_zer ) ! 48: Q52_current_exiting (0 ) ! 49: Q54_rowcount (Q53_no_quip_chosen ) ! 50: Q56_first_chat_node (Q53_no_quip_chosen ) ! 51: Q57_second_chat_node (T3_ordinary_status) ! 52: Q58_status_bar_table (14) ! 53: Q59_right_alignment_depth (0) ! 54: Q60_test_key_strokes_boolean (selfobj) ! 55: Q61_prior_named_noun (0 ) ! 56: Q62_dicelock (1) ! 57: Q63_numbers_boolean (selfobj ) ! 58: Q64_global_actor (0 ) ! 59: Q65_first_dummy (0 ) ! 60: Q66_second_dummy (0 ) ! 61: Q67_third_dummy (0 ) ! 62: Q68_fourth_dummy (0) ! 63: Q81_fight_consequences_varia (selfobj ) ! 64: Q82_global_attacker (selfobj ) ! 65: Q83_global_defender (O33_your_natural_weapon ) ! 66: Q84_global_attacker_weapon (O33_your_natural_weapon ) ! 67: Q85_global_defender_weapon (0 ) ! 68: Q86_to_hit_roll (0 ) ! 69: Q87_to_hit_modifier (0 ) ! 70: Q88_damage (0 ) ! 71: Q89_damage_modifier (0 ) ! 72: Q90_final_damage (0) ! 73: Q91_global_flavour_text_bool (0 ) ! 74: Q92_stored_row (selfobj ) ! 75: Q93_stored_person (O33_your_natural_weapon ) ! 76: Q94_stored_weapon (0 ) ! 77: Q95_stored_action (false ) ! 78: Q96_found_a_target_boolean (0 ) ! 79: Q97_chance_to_win (0) ! 80: Q98_charge_boolean (selfobj ) ! 81: Q111_actor (false ) ! 82: Q112_action_in_world (false ) ! 83: Q113_action_keeping_silent (0 ) ! 84: Q114_specific_check_rulebook (0 ) ! 85: Q115_specific_carry_out_rule (0 ) ! 86: Q116_specific_report_ruleboo (false ) ! 87: Q117_within_the_player_s_sig (O37_your_room ) ! 88: Q118_room_gone_from (nothing ) ! 89: Q119_room_gone_to (nothing ) ! 90: Q120_door_gone_through (nothing ) ! 91: Q121_vehicle_gone_by (nothing ) ! 92: Q122_thing_gone_with (nothing ) ! 93: Q123_container_exited_from (##Wait ) ! 94: Q124_room_describing_action (false ) ! 95: Q125_abbreviated_form_allowe (0 ) ! 96: Q126_visibility_level_count (nothing ) ! 97: Q127_visibility_ceiling NULL ; ! extent 98 words Constant NUMBER_RULEBOOKS_CREATED = 430; Constant V0_printing_the_name_of_some = 0; Constant V1_printing_the_plural_name_ = 1; Constant V2_printing_a_number_of_some = 2; Constant V3_printing_room_description = 3; Constant V4_listing_contents_of_somet = 4; Constant V5_grouping_together_somethi = 5; Constant V6_writing_a_paragraph_about = 6; Constant V7_listing_nondescript_items = 7; Constant V8_printing_the_name_of_a_da = 8; Constant V9_printing_the_description_ = 9; Constant V10_printing_the_announcemen = 10; Constant V11_printing_the_announcemen = 11; Constant V12_printing_a_refusal_to_ac = 12; Constant V13_constructing_the_status_ = 13; Constant V14_printing_the_banner_text = 14; Constant V15_reading_a_command = 15; Constant V16_deciding_the_scope_of_so = 16; Constant V17_deciding_the_concealed_p = 17; Constant V18_deciding_whether_all_inc = 18; Constant V19_clarifying_the_parser_s_ = 19; Constant V20_asking_which_do_you_mean = 20; Constant V21_printing_a_parser_error = 21; Constant V22_supplying_a_missing_noun = 22; Constant V23_supplying_a_missing_seco = 23; Constant V24_implicitly_taking_someth = 24; Constant V25_starting_the_virtual_mac = 25; Constant V26_amusing_a_victorious_pla = 26; Constant V27_printing_the_player_s_ob = 27; Constant V28_handling_the_final_quest = 28; Constant V29_printing_the_locale_desc = 29; Constant V30_choosing_notable_locale_ = 30; Constant V31_printing_a_locale_paragr = 31; Array Activity_before_rulebooks --> 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 NULL; Array Activity_for_rulebooks --> 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 NULL; Array Activity_after_rulebooks --> 29 32 35 38 41 44 47 50 53 56 59 62 65 68 71 74 77 80 83 86 89 92 95 98 101 104 107 110 113 116 119 122 NULL; Array Activity_atb_rulebooks -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 $ff; Array relation_metadata --> 0 Relation_Implicit "is" 0 Relation_Implicit "provides" 0 (-1) "provides-r" 0 Relation_Implicit "greater-than" 0 (-1) "greater-than-r" 0 Relation_Implicit "less-than" 0 (-1) "less-than-r" 0 Relation_Implicit "at-least" 0 (-1) "at-least-r" 0 Relation_Implicit "at-most" 0 (-1) "at-most-r" 0 Relation_Implicit "contains" 0 (-1) "is-in" 0 Relation_Implicit "supports" 0 (-1) "is-on" 0 Relation_Implicit "incorporates" 0 (-1) "is-part-of" 0 Relation_Implicit "carries" 0 (-1) "is-carried-by" 0 Relation_Implicit "holds" 0 (-1) "is-held-by" 0 Relation_Implicit "wears" 0 (-1) "is-worn-by" 0 Relation_Implicit "has" 0 (-1) "is-had-by" 0 Relation_Implicit "can-see" 0 (-1) "can-be-seen-by" 0 Relation_Implicit "can-touch" 0 (-1) "can-be-touched-by" 0 Relation_Implicit "conceals" 0 (-1) "is-concealed-by" 0 Relation_Implicit "encloses" 0 (-1) "is-enclosed-by" 0 Relation_Implicit "adjacent-to" 0 (-1) "adjacent-from" 0 Relation_Implicit "region-contains" 0 (-1) "in-region" 0 Relation_Implicit "north-map" 0 (-1) "north-map-r" 0 Relation_Implicit "northeast-map" 0 (-1) "northeast-map-r" 0 Relation_Implicit "northwest-map" 0 (-1) "northwest-map-r" 0 Relation_Implicit "south-map" 0 (-1) "south-map-r" 0 Relation_Implicit "southeast-map" 0 (-1) "southeast-map-r" 0 Relation_Implicit "southwest-map" 0 (-1) "southwest-map-r" 0 Relation_Implicit "east-map" 0 (-1) "east-map-r" 0 Relation_Implicit "west-map" 0 (-1) "west-map-r" 0 Relation_Implicit "up-map" 0 (-1) "up-map-r" 0 Relation_Implicit "down-map" 0 (-1) "down-map-r" 0 Relation_Implicit "inside-map" 0 (-1) "inside-map-r" 0 Relation_Implicit "outside-map" 0 (-1) "outside-map-r" door_to Relation_OtoV "Leading-through relates one room (called the other side) to various doors" door_to (-1) "Leading-through relates one room (called the other side) to various doors" with_key Relation_OtoV "Lock-fitting relates one thing (called the matching key) to various things" with_key (-1) "Lock-fitting relates one thing (called the matching key) to various things" V2V_Bitmap_65 Relation_VtoV "Activation relates various chat nodes to various activatednesses" V2V_Bitmap_65 (-1) "Activation relates various chat nodes to various activatednesses" V2V_Bitmap_67 Relation_VtoV "Pressing relates various people to various people" V2V_Bitmap_67 (-1) "Pressing relates various people to various people" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "listed_in" 0 (-1) "lists-in" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "set-property" 0 (-1) "set-property-r" 0 Relation_Implicit "same-description-as" 0 (-1) "same-description-as-r" 0 Relation_Implicit "same-printed-name-as" 0 (-1) "same-printed-name-as-r" 0 Relation_Implicit "same-map-region-as" 0 (-1) "same-map-region-as-r" 0 Relation_Implicit "same-indefinite-article-as" 0 (-1) "same-indefinite-article-as-r" 0 Relation_Implicit "same-initial-appearance-as" 0 (-1) "same-initial-appearance-as-r" 0 Relation_Implicit "same-printed-plural-name-as" 0 (-1) "same-printed-plural-name-as-r" 0 Relation_Implicit "same-opposite-as" 0 (-1) "same-opposite-as-r" 0 Relation_Implicit "same-other-side-as" 0 (-1) "same-other-side-as-r" 0 Relation_Implicit "same-carrying-capacity-as" 0 (-1) "same-carrying-capacity-as-r" 0 Relation_Implicit "same-matching-key-as" 0 (-1) "same-matching-key-as-r" 0 Relation_Implicit "same-health-as" 0 (-1) "same-health-as-r" 0 Relation_Implicit "same-permanent-health-as" 0 (-1) "same-permanent-health-as-r" 0 Relation_Implicit "same-gained-health-as" 0 (-1) "same-gained-health-as-r" 0 Relation_Implicit "same-melee-as" 0 (-1) "same-melee-as-r" 0 Relation_Implicit "same-defence-as" 0 (-1) "same-defence-as-r" 0 Relation_Implicit "same-damage-die-as" 0 (-1) "same-damage-die-as-r" 0 Relation_Implicit "same-initiative-modifier-as" 0 (-1) "same-initiative-modifier-as-r" 0 Relation_Implicit "same-concentration-as" 0 (-1) "same-concentration-as-r" 0 Relation_Implicit "same-combat-ai-rulebook-as" 0 (-1) "same-combat-ai-rulebook-as-r" 0 Relation_Implicit "same-dodgability-as" 0 (-1) "same-dodgability-as-r" 0 Relation_Implicit "same-passive-parry-max-as" 0 (-1) "same-passive-parry-max-as-r" 0 Relation_Implicit "same-active-parry-max-as" 0 (-1) "same-active-parry-max-as-r" 0 Relation_Implicit "same-weapon-attack-bonus-as" 0 (-1) "same-weapon-attack-bonus-as-r" 0 Relation_Implicit "same-maximum-shots-as" 0 (-1) "same-maximum-shots-as-r" 0 Relation_Implicit "same-current-shots-as" 0 (-1) "same-current-shots-as-r" 0 Relation_Implicit "same-maximum-load-time-as" 0 (-1) "same-maximum-load-time-as-r" 0 Relation_Implicit "same-current-load-time-as" 0 (-1) "same-current-load-time-as-r" 0 Relation_Implicit "same-activation-relates-as" 0 (-1) "same-activation-relates-as-r" 0 Relation_Implicit "same-hostility-as" 0 (-1) "same-hostility-as-r" 0 Relation_Implicit "same-pressing-relates-as" 0 (-1) "same-pressing-relates-as-r" 0 Relation_Implicit "same-combat-state-as" 0 (-1) "same-combat-state-as-r" 0 Relation_Implicit "same-react-state-as" 0 (-1) "same-react-state-as-r" 0 Relation_Implicit "same-specification-as" 0 (-1) "same-specification-as-r" 0 Relation_Implicit "aliveness" 0 (-1) "aliveness-r" 0 Relation_Implicit "killedness" 0 (-1) "killedness-r" NULL; [ T46_conversation_exiting value; switch(value) { Q50_player_may_exit_upon_zer: print "player may exit upon zero"; Q51_player_may_not_exit: print "player may not exit"; default: print ""; } ]; [ A_T46_conversation_exiting value; return (value % 2)+1; ]; [ B_T46_conversation_exiting value; return ((value+0) % 2)+1; ]; [ R_T46_conversation_exiting a b; if (a == 0 && b == 0) return (random(2)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ T47_chat_node value; switch(value) { Q53_no_quip_chosen: print "no quip chosen"; Q99_set_values_1: print "set_values_1"; Q100_set_values_2: print "set_values_2"; Q101_set_values_3: print "set_values_3"; Q102_set_values_4: print "set_values_4"; Q103_set_values_5: print "set_values_5"; Q104_set_values_6: print "set_values_6"; default: print ""; } ]; [ A_T47_chat_node value; return (value % 7)+1; ]; [ B_T47_chat_node value; return ((value+5) % 7)+1; ]; [ R_T47_chat_node a b; if (a == 0 && b == 0) return (random(7)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ T48_activatedness value; switch(value) { Q55_quip_on: print "quip on"; default: print ""; } ]; [ A_T48_activatedness value; return (value % 1)+1; ]; [ B_T48_activatedness value; return ((value+-1) % 1)+1; ]; [ R_T48_activatedness a b; if (a == 0 && b == 0) return (random(1)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ T49_hostility value; switch(value) { Q69_neutral: print "neutral"; Q70_friendly: print "friendly"; Q71_hostile: print "hostile"; Q72_hostile_2: print "hostile_2"; Q73_hostile_3: print "hostile_3"; Q74_hostile_4: print "hostile_4"; default: print ""; } ]; [ A_T49_hostility value; return (value % 6)+1; ]; [ B_T49_hostility value; return ((value+4) % 6)+1; ]; [ R_T49_hostility a b; if (a == 0 && b == 0) return (random(6)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ T50_combat_state value; switch(value) { Q75_none: print "None"; Q76_acted: print "Acted"; Q77_react: print "React"; default: print ""; } ]; [ A_T50_combat_state value; return (value % 3)+1; ]; [ B_T50_combat_state value; return ((value+1) % 3)+1; ]; [ R_T50_combat_state a b; if (a == 0 && b == 0) return (random(3)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ T51_react_state value; switch(value) { Q78_no_react: print "No React"; Q79_defensive: print "Defensive"; Q80_aggressive: print "Aggressive"; default: print ""; } ]; [ A_T51_react_state value; return (value % 3)+1; ]; [ B_T51_react_state value; return ((value+1) % 3)+1; ]; [ R_T51_react_state a b; if (a == 0 && b == 0) return (random(3)); if (a == b) return b; if (a > b) return b+(random(MAX_POSITIVE_NUMBER) % (a-b+1)); return a+(random(MAX_POSITIVE_NUMBER) % (b-a+1)); ]; [ PrintKindValuePair k v; switch(k) { 50: print (DecimalNumber) v; 51: print (DecimalNumber) v; 52: print (DecimalNumber) v; 53: print (DecimalNumber) v; 54: print (DecimalNumber) v; 55: print (DecimalNumber) v; 56: print (DecimalNumber) v; 57: print (DecimalNumber) v; 58: print (PrintTimeOfDay) v; 59: print (PrintText) v; 60: print (DecimalNumber) v; 61: print (DecimalNumber) v; 62: print (PrintSnippet) v; 63: print (DecimalNumber) v; 64: print (PrintShortName) v; 65: print (DecimalNumber) v; 66: print (DecimalNumber) v; 67: print (DecimalNumber) v; 68: print (RulePrintingRule) v; 69: print (RulePrintingRule) v; 70: print (RulebookOutcomePrintingRule) v; 71: print (SayActionName) v; 72: print (DecimalNumber) v; 73: print (PrintSceneName) v; 74: print (PrintTableName) v; 75: print (DecimalNumber) v; 76: print (DA_Number) v; 77: print (DecimalNumber) v; 78: print (DecimalNumber) v; 79: print (PrintFigureName) v; 80: print (PrintSoundName) v; 81: print (PrintExternalFileName) v; 82: print (DA_TruthState) v; 83: print (INDEXED_TEXT_TY_Say) v; 84: print (STORED_ACTION_TY_Say) v; 85: print (LIST_OF_TY_Say) v; 86: print (DA_Number) v; 87: print (DecimalNumber) v; 88: print (DecimalNumber) v; 89: print (DecimalNumber) v; 90: print (DecimalNumber) v; 91: print (DecimalNumber) v; 92: print (DecimalNumber) v; 93: print (DecimalNumber) v; 94: print (DecimalNumber) v; 100: print (T46_conversation_exiting) v; 101: print (T47_chat_node) v; 102: print (T48_activatedness) v; 103: print (T49_hostility) v; 104: print (T50_combat_state) v; 105: print (T51_react_state) v; default: print v; } ]; [ DefaultValueOfKOV k; switch(k) { 57: return 0 ; 58: return 540 ; 59: return EMPTY_TEXT_VALUE ; 62: return 101 ; 64: return nothing ; 65: return Prop_Falsity ; 68: return LITTLE_USED_DO_NOTHING_R ; 69: return 0 ; 71: return ##Wait ; 72: return PRINTING_THE_NAME_ACT ; 73: return 0 ; 74: return TheEmptyTable ; 76: return 0 ; 79: return 1 ; 80: return 0 ; 81: return 0 ; 82: return false ; 83: return 0 ; 84: return 0 ; 85: return 0 ; 100: return Q50_player_may_exit_upon_zer ; 101: return Q53_no_quip_chosen ; 102: return Q55_quip_on ; 103: return Q69_neutral ; 104: return Q75_none ; 105: return Q78_no_react ; default: return 0; } ]; [ KOVComparisonFunction k; switch(k) { 59: return UnsignedCompare; 62: return UnsignedCompare; 64: return UnsignedCompare; 65: return UnsignedCompare; 68: return UnsignedCompare; 69: return UnsignedCompare; 71: return UnsignedCompare; 72: return UnsignedCompare; 73: return UnsignedCompare; 74: return UnsignedCompare; 76: return UnsignedCompare; 79: return UnsignedCompare; 80: return UnsignedCompare; 81: return UnsignedCompare; 82: return UnsignedCompare; 83: return BlkValueCompare; 84: return BlkValueCompare; 85: return BlkValueCompare; default: return 0; } ]; [ KOVIsBlockValue k; if (k == 83 or 84 or 85) rtrue; rfalse; ]; [ KOVSupportFunction k; switch(k) { 83: return INDEXED_TEXT_TY_Support; 84: return STORED_ACTION_TY_Support; 85: return LIST_OF_TY_Support; } rfalse; ]; Array KOVP_73 --> 1 ! Properties for Q41_entire_game 0 ; [ I7_Kind_Name k; if (k == K1_room) print "room"; if (k == K2_thing) print "thing"; if (k == K3_direction) print "direction"; if (k == K4_door) print "door"; if (k == K5_container) print "container"; if (k == K6_supporter) print "supporter"; if (k == K7_backdrop) print "backdrop"; if (k == K8_person) print "person"; if (k == K9_region) print "region"; if (k == K23_man) print "man"; if (k == K24_woman) print "woman"; if (k == K25_animal) print "animal"; if (k == K26_device) print "device"; if (k == K27_vehicle) print "vehicle"; if (k == K28_player_s_holdall) print "player's holdall"; if (k == K30_monster) print "monster"; if (k == K31_weapon) print "weapon"; if (k == K32_natural_weapon) print "natural weapon"; if (k == K34_sword) print "sword"; if (k == K35_spear) print "spear"; ]; Constant RBNO_0 = "allow access"; Constant RBNO_1 = "deny access"; Constant RBNO_2 = "there is sufficient light"; Constant RBNO_3 = "there is insufficient light"; Constant RBNO_4 = "persuasion succeeds"; Constant RBNO_5 = "persuasion fails"; Constant RBNO_6 = "it is very likely"; Constant RBNO_7 = "it is likely"; Constant RBNO_8 = "it is possible"; Constant RBNO_9 = "it is unlikely"; Constant RBNO_10 = "it is very unlikely"; Constant RBNO_11 = "it does not"; Constant RBNO_12 = "it does"; [ RulebookOutcomePrintingRule rbno; print (string) rbno; rfalse; ]; Object property_numberspace_forcer ; Array KindHierarchy --> K0_kind (0) K1_room (0) K2_thing (0) K3_direction (0) K4_door (2) K5_container (2) K6_supporter (2) K7_backdrop (2) K8_person (2) K9_region (0) K23_man (8) K24_woman (8) K25_animal (8) K26_device (2) K27_vehicle (5) K28_player_s_holdall (5) K30_monster (8) K31_weapon (2) K32_natural_weapon (17) K34_sword (17) K35_spear (17) ; Constant No_Directions = 12; Array Map_Storage --> ! O10_north O11_northeast O12_northwest O13_south O14_southeast O15_southwest O16_east O17_west O18_up O19_down in_obj out_obj 0 0 0 O41_courtyard 0 0 0 0 0 0 0 0 ! Exits from: O37_your_room O37_your_room 0 0 0 0 0 O45_megaron O42_entrance_gate 0 0 0 0 ! Exits from: O41_courtyard 0 0 0 0 0 0 O41_courtyard 0 0 0 0 0 ! Exits from: O42_entrance_gate 0 0 0 0 0 0 0 O41_courtyard 0 0 0 0 ! Exits from: O45_megaron ; Class K0_kind with vector 0 ; Class K1_room class K0_kind with vector 0 has light has ~visited with map_region nothing with plural "rooms" ; Class K2_thing class K0_kind with component_parent nothing, component_sibling nothing, component_child nothing, with vector 0 has ~p72_ambiguously_plural has ~light has ~edible has ~static has ~pluralname has ~proper has ~concealed has ~workflag has mentioned has neuter with action_bitmap 0 0 0 0 0 0 ; Class K3_direction class K0_kind class CompassDirection, with vector 0 has ~workflag with plural "directions" with p6_opposite O10_north , ; Class K4_door class K2_thing has door, with vector 0 has static has ~pushable has ~open has openable has ~lockable has ~locked with plural "doors" has mark_as_thing, ; Class K5_container class K2_thing has container, with vector 0 has ~transparent has open has ~openable has ~lockable has ~locked with capacity 100 with plural "containers" has mark_as_thing, ; Class K6_supporter class K2_thing has transparent supporter with vector 0 has static with capacity 100 with plural "supporters" has mark_as_thing, ; Class K7_backdrop class K2_thing with vector 0 has static has scenery has ~pushable with plural "backdrops" has mark_as_thing, ; Class K8_person class K2_thing has transparent animate with before NULL, ! number 0, with vector 0 with p77_react_state Q78_no_react has ~p80_at_parry has ~p82_at_dodge with p74_hostility Q69_neutral with p76_combat_state Q75_none has ~female has ~neuter with capacity 100 with p10_health 10 with p13_melee 0 with p14_defence 7 with p15_damage_die 6 with p16_initiative_modifier 0 with p17_concentration 0 with p18_combat_ai_rulebook 415 with plural "people" has mark_as_thing, with p11_permanent_health 0 , with p12_gained_health 0 , ; Class K9_region class K0_kind with vector 0 with plural "regions" ; Class K23_man class K8_person with vector 0 has ~female has ~neuter with plural "men" has mark_as_thing, ; Class K24_woman class K8_person with vector 0 has female has ~neuter with plural "women" has mark_as_thing, ; Class K25_animal class K8_person with vector 0 with plural "animals" has mark_as_thing, ; Class K26_device class K2_thing has switchable, with vector 0 has ~on with plural "devices" has mark_as_thing, ; Class K27_vehicle class K5_container with vector 0 has static has enterable with plural "vehicles" has mark_as_thing, ; Class K28_player_s_holdall class K5_container with vector 0 has ~static has openable with plural "player's holdalls" has mark_as_thing, ; Class K30_monster class K8_person with vector 0 with p74_hostility Q71_hostile with plural "monsters" has mark_as_thing, ; Class K31_weapon class K2_thing with vector 0 has ~p78_readied with p15_damage_die 6 with p19_dodgability 2 with p20_passive_parry_max 2 with p21_active_parry_max 2 with p22_weapon_attack_bonus 0 with p23_maximum_shots 0 with p24_current_shots 0 with p25_maximum_load_time 0 with p26_current_load_time 0 with plural "weapons" has mark_as_thing, ; Class K32_natural_weapon class K31_weapon with vector 0 with p15_damage_die 3 with p19_dodgability 2 with p20_passive_parry_max 2 with p21_active_parry_max 0 with plural "natural weapons" has mark_as_thing, ; Class K34_sword class K31_weapon with vector 0 with p15_damage_die 6 with p19_dodgability 1 with p20_passive_parry_max 2 with p21_active_parry_max 3 with p22_weapon_attack_bonus 0 with plural "swords" has mark_as_thing, ; Class K35_spear class K31_weapon with vector 0 with p15_damage_die 8 with p19_dodgability 3 with p20_passive_parry_max 0 with p21_active_parry_max 0 with p22_weapon_attack_bonus 2 with plural "spears" has mark_as_thing, ; Object ValuePropertyHolder ; Object O10_north "" Compass class K3_direction with IK3_Link O11_northeast, with name 'north' 'n//' with parse_name Parse_Name_GV1 with vector 0 with p6_opposite O13_south with IK_0 3 with IK_3 0 with short_name "north" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O11_northeast "" Compass class K3_direction with IK3_Link O12_northwest, with name 'northeast' 'ne' with parse_name Parse_Name_GV2 with vector 0 with p6_opposite O15_southwest with IK_0 3 with IK_3 1 with short_name "northeast" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O12_northwest "" Compass class K3_direction with IK3_Link O13_south, with name 'northwest' 'nw' with parse_name Parse_Name_GV3 with vector 0 with p6_opposite O14_southeast with IK_0 3 with IK_3 2 with short_name "northwest" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O13_south "" Compass class K3_direction with IK3_Link O14_southeast, with name 'south' 's//' with parse_name Parse_Name_GV4 with vector 0 with p6_opposite O10_north with IK_0 3 with IK_3 3 with short_name "south" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O14_southeast "" Compass class K3_direction with IK3_Link O15_southwest, with name 'southeast' 'se' with parse_name Parse_Name_GV5 with vector 0 with p6_opposite O12_northwest with IK_0 3 with IK_3 4 with short_name "southeast" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O15_southwest "" Compass class K3_direction with IK3_Link O16_east, with name 'southwest' 'sw' with parse_name Parse_Name_GV6 with vector 0 with p6_opposite O11_northeast with IK_0 3 with IK_3 5 with short_name "southwest" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O16_east "" Compass class K3_direction with IK3_Link O17_west, with name 'east' 'e//' with parse_name Parse_Name_GV7 with vector 0 with p6_opposite O17_west with IK_0 3 with IK_3 6 with short_name "east" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O17_west "" Compass class K3_direction with IK3_Link O18_up, with name 'west' 'w//' with parse_name Parse_Name_GV8 with vector 0 with p6_opposite O16_east with IK_0 3 with IK_3 7 with short_name "west" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O18_up "" Compass class K3_direction with IK3_Link O19_down, with name 'up' 'u//' with parse_name Parse_Name_GV9 with vector 0 with p6_opposite O19_down with IK_0 3 with IK_3 8 with short_name "up" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O19_down "" Compass class K3_direction with IK3_Link in_obj, with name 'down' 'd//' with parse_name Parse_Name_GV10 with vector 0 with p6_opposite O18_up with IK_0 3 with IK_3 9 with short_name "down" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object in_obj "" Compass class K3_direction with IK3_Link out_obj, with name 'inside' 'in' with parse_name Parse_Name_GV11 with vector 0 with p6_opposite out_obj with IK_0 3 with IK_3 10 with short_name "inside" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object out_obj "" Compass class K3_direction with IK3_Link nothing, with name 'outside' 'out' with parse_name Parse_Name_GV12 with vector 0 with p6_opposite in_obj with IK_0 3 with IK_3 11 with short_name "outside" with list_together 0, with action_bitmap 0 0 0 0 0 0 ; Object O29_here_backdrop "" class K7_backdrop with IK7_Link O36_chorus, with IK2_Link O33_your_natural_weapon, with name 'here-backdrop' 'here' with parse_name Parse_Name_GV95 with vector 0 with found_in FoundEverywhere, with IK_0 7 with IK_2 1 with IK_7 0 with short_name "here-backdrop" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O33_your_natural_weapon "" class K32_natural_weapon with IK32_Link O44_assassin_s_natural_weapo, with IK31_Link O39_your_sword, with IK2_Link O36_chorus, with name 'my' 'natural' 'weapon' with vector 0 with component_parent selfobj has proper with IK_0 18 with IK_2 2 with IK_31 0 with IK_32 0 with short_name "your natural weapon" with cap_short_name "Your natural weapon" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O36_chorus "" class K7_backdrop with IK7_Link nothing, with IK2_Link selfobj, with name 'chorus' 'we' 'you' 'chorus' 'bearers' 'libation' 'maidens' 'maiden' with parse_name Parse_Name_GV106 with vector 0 with found_in FoundEverywhere, with IK_0 7 with IK_2 3 with IK_7 1 with short_name "chorus" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O37_your_room "" class K1_room with IK1_Link O41_courtyard, with name 'my' 'room' with vector 0 with room_index -1 has proper has proper with description SC_5 with IK_0 1 with IK_1 0 with short_name "Your room" with list_together 0, has mark_as_room, ; Object -> selfobj "" class K8_person with IK8_Link O43_assassin, with IK2_Link O38_large_chest, has proper, with saved_short_name "yourself", with name 'yourself' with vector 0 with component_child O33_your_natural_weapon with p74_hostility Q70_friendly has proper has concealed with description SC_6 with IK_0 8 with IK_2 0 with IK_8 0 with short_name "yourself" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object -> O38_large_chest "" class K5_container with IK5_Link nothing, with IK2_Link O39_your_sword, with name 'large' 'chest' with vector 0 has static has scenery has ~open has openable has lockable has locked with IK_0 5 with IK_2 4 with IK_5 0 with short_name "large chest" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object -> O39_your_sword "" class K34_sword with IK34_Link nothing, with IK31_Link X40, with IK2_Link X40, with name 'my' 'sword' with vector 0 has proper has proper with initial SC_7 with IK_0 19 with IK_2 5 with IK_31 1 with IK_34 0 with short_name "your sword" with cap_short_name "Your sword" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object -> X40 "" class K35_spear with IK35_Link nothing, with IK31_Link O44_assassin_s_natural_weapo, with IK2_Link O43_assassin, with name 'spear' 'spears//p' with vector 0 with IK_0 20 with IK_2 6 with IK_31 2 with IK_35 0 with short_name "spear" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O41_courtyard "" class K1_room with IK1_Link O42_entrance_gate, with name 'courtyard' with vector 0 with room_index -1 has proper has proper with description SC_8 with IK_0 1 with IK_1 1 with short_name "Courtyard" with list_together 0, has mark_as_room, ; Object O42_entrance_gate "" class K1_room with IK1_Link O45_megaron, with name 'entrance' 'gate' with vector 0 with room_index -1 has proper has proper with description SC_9 with IK_0 1 with IK_1 2 with short_name "Entrance Gate" with list_together 0, has mark_as_room, ; Object -> O43_assassin "" class K8_person with IK8_Link O46_boar, with IK2_Link O44_assassin_s_natural_weapo, with name 'assassin' with vector 0 with component_child O44_assassin_s_natural_weapo with p74_hostility Q71_hostile with IK_0 8 with IK_2 7 with IK_8 1 with short_name "assassin" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O44_assassin_s_natural_weapo "" class K32_natural_weapon with IK32_Link O47_boar_s_natural_weapon, with IK31_Link O47_boar_s_natural_weapon, with IK2_Link O46_boar, with name 'assassin^s' 'natural' 'weapon' with vector 0 with component_parent O43_assassin with IK_0 18 with IK_2 8 with IK_31 3 with IK_32 1 with short_name "assassin's natural weapon" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O45_megaron "" class K1_room with IK1_Link nothing, with name 'megaron' with vector 0 with room_index -1 has proper has proper with description SC_10 with IK_0 1 with IK_1 3 with short_name "Megaron" with list_together 0, has mark_as_room, ; Object -> O46_boar "" class K25_animal with IK25_Link nothing, with IK8_Link nothing, with IK2_Link O47_boar_s_natural_weapon, with name 'boar' with vector 0 with component_child O47_boar_s_natural_weapon with p74_hostility Q71_hostile with p10_health 14 with p13_melee 4 with p14_defence 8 with IK_0 12 with IK_2 9 with IK_8 2 with IK_25 0 with short_name "boar" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Object O47_boar_s_natural_weapon "" class K32_natural_weapon with IK32_Link nothing, with IK31_Link nothing, with IK2_Link nothing, with name 'boar^s' 'natural' 'weapon' with vector 0 with component_parent O46_boar with p15_damage_die 6 with p19_dodgability 2 with p20_passive_parry_max 1 with p21_active_parry_max 2 with IK_0 18 with IK_2 10 with IK_31 4 with IK_32 2 with short_name "boar's natural weapon" with list_together 0, has mark_as_thing, with action_bitmap 0 0 0 0 0 0 ; Constant IK0_First = O10_north; Constant IK1_First = O37_your_room; Constant IK2_First = O29_here_backdrop; Constant IK3_First = O10_north; Constant IK4_First = nothing; Constant IK5_First = O38_large_chest; Constant IK6_First = nothing; Constant IK7_First = O29_here_backdrop; Constant IK8_First = selfobj; Constant IK9_First = nothing; Constant IK23_First = nothing; Constant IK24_First = nothing; Constant IK25_First = O46_boar; Constant IK26_First = nothing; Constant IK27_First = nothing; Constant IK28_First = nothing; Constant IK30_First = nothing; Constant IK31_First = O33_your_natural_weapon; Constant IK32_First = O33_your_natural_weapon; Constant IK34_First = O39_your_sword; Constant IK35_First = X40; ! Table of direction object alias constants: Constant DirectionObject_0 = O10_north; Constant DirectionObject_1 = O11_northeast; Constant DirectionObject_2 = O12_northwest; Constant DirectionObject_3 = O13_south; Constant DirectionObject_4 = O14_southeast; Constant DirectionObject_5 = O15_southwest; Constant DirectionObject_6 = O16_east; Constant DirectionObject_7 = O17_west; Constant DirectionObject_8 = O18_up; Constant DirectionObject_9 = O19_down; Constant DirectionObject_10 = in_obj; Constant DirectionObject_11 = out_obj; Array V2V_Bitmap_65 --> 0 0 7 ! Number of left instances 1 ! Number of right instances T47_chat_node ! To print left instances T48_activatedness ! To print right instances true ! Cache broken flag V2V_Route_Cache_65 ! Cache array (if any) $0000 ; Constant V2V_Route_Cache_65 = 0; Array V2V_Bitmap_67 --> IK_8 IK_8 3 ! Number of left instances 3 ! Number of right instances PrintShortName ! To print left instances PrintShortName ! To print right instances true ! Cache broken flag V2V_Route_Cache_67 ! Cache array (if any) ! Left-count 0 = selfobj ! Left-count 1 = O43_assassin ! Left-count 2 = O46_boar ! Right-count 0 = selfobj ! Right-count 1 = O43_assassin ! Right-count 2 = O46_boar $0000 ; Constant V2V_Route_Cache_67 = 0; Array T0_final_question_options table tab_0_0 tab_0_1 tab_0_2 tab_0_3 tab_0_4; Array tab_0_0 table $0064 0 (SC_11) (SC_12) (SC_13) (SC_14) TABLE_NOVALUE; Array tab_0_1 table $0465 1 (0) (0) (1) (0) (0) ; Array tab_0_2 table $2066 2 (Consult_Grammar_107) (Consult_Grammar_108) (Consult_Grammar_109) (Consult_Grammar_110) (Consult_Grammar_111) ; Array tab_0_3 table $0067 3 (IMMEDIATELY_RESTART_VM_R) (IMMEDIATELY_RESTORE_SAVED_R) TABLE_NOVALUE (IMMEDIATELY_QUIT_R) (IMMEDIATELY_UNDO_R) ; Array tab_0_4 table $0068 4 TABLE_NOVALUE TABLE_NOVALUE (V26_amusing_a_victorious_pla) TABLE_NOVALUE TABLE_NOVALUE; Array T1_locale_priorities table tab_1_0 tab_1_1; Array tab_1_0 table $0869 NULL TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_1_1 table $446a 5 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T2_current_choices --> 1 tab_2_0; Array tab_2_0 table $4c6b NULL TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T3_ordinary_status table tab_3_0 tab_3_1 tab_3_2; Array tab_3_0 table $006c 7 (text_routine_0) ; Array tab_3_1 table $006d 8 (EMPTY_TEXT_VALUE) ; Array tab_3_2 table $006e 9 (text_routine_1) ; Array T4_combat_order table tab_4_0 tab_4_1; Array tab_4_0 table $086f NULL TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_4_1 table $4470 10 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T5_stored_combat_actions table tab_5_0 tab_5_1; Array tab_5_0 table $4471 17 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_5_1 table $0672 24 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T6_ai_combat_person_options table tab_6_0 tab_6_1; Array tab_6_0 table $0873 NULL TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_6_1 table $4474 31 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T7_ai_combat_options table tab_7_0 tab_7_1; Array tab_7_0 table $0675 44 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_7_1 table $4474 57 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array T8_ai_combat_weapon_options table tab_8_0 tab_8_1; Array tab_8_0 table $0876 NULL TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array tab_8_1 table $4474 70 TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE TABLE_NOVALUE; Array TB_Blanks -> ! For table T0_final_question_options $10 ! Column 0 $00 ! Column 1 $00 ! Column 2 $04 ! Column 3 $1b ! Column 4 ! For table T1_locale_priorities $ff $0f ! Column 1 ! For table T2_current_choices ! For table T3_ordinary_status $00 ! Column 0 $00 ! Column 1 $00 ! Column 2 ! For table T4_combat_order $ff $ff $ff $ff $ff $ff $07 ! Column 1 ! For table T5_stored_combat_actions $ff $ff $ff $ff $ff $ff $07 ! Column 0 $ff $ff $ff $ff $ff $ff $07 ! Column 1 ! For table T6_ai_combat_person_options $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $1f ! Column 1 ! For table T7_ai_combat_options $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $1f ! Column 0 $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $ff $1f ! Column 1 ! For table T8_ai_combat_weapon_options $ff $ff $ff $7f ! Column 1 ! End of table NULL NULL; Array TC_KOVs --> 100 59 0 101 82 0 102 78 0 103 68 0 104 72 0 105 64 0 106 57 0 107 101 0 108 59 0 109 59 0 110 59 0 111 64 0 112 57 0 113 57 0 114 84 0 115 64 0 116 57 0 117 84 0 118 64 0 0 0; Array TableOfTables --> TheEmptyTable T0_final_question_options T1_locale_priorities T2_current_choices T3_ordinary_status T4_combat_order T5_stored_combat_actions T6_ai_combat_person_options T7_ai_combat_options T8_ai_combat_weapon_options 0 0; [ NAP_0; if ((action ==##Verify)) rtrue; rfalse; ]; [ NAP_1; if ((action ==##Examine) && ((noun ofclass K2_thing))) rtrue; if ((action ==##Inv)) rtrue; if ((action ==##Smell)) rtrue; if ((action ==##Smell) && ((noun ofclass K2_thing))) rtrue; if ((action ==##Look)) rtrue; if ((action ==##LookUnder) && ((noun ofclass K2_thing))) rtrue; if ((action ==##Listen)) rtrue; if ((action ==##Listen) && ((noun ofclass K2_thing))) rtrue; if ((action ==##Think)) rtrue; rfalse; ]; Array ActionData table ##Inv $$00000000 64 64 "taking inventory" NULL NULL NULL NULL 0 20000 ##Take $$00001001 64 64 "taking" DA_Name NULL NULL NULL 0 20001 ##Remove $$00011011 64 64 "removing" DA_Name "from" DA_Name NULL 0 20002 ##Drop $$00001001 64 64 "dropping" DA_Name NULL NULL NULL 0 20003 ##PutOn $$00011011 64 64 "putting" DA_Name "on" DA_Name NULL 0 20004 ##Insert $$00011011 64 64 "inserting" DA_Name "into" DA_Name NULL 0 20005 ##Eat $$01001001 64 64 "eating" DA_Name NULL NULL NULL 0 20006 ##Go $$00001000 64 64 "going" DA_Name NULL NULL NULL ANSTVC_7 20007 ##Enter $$00001001 64 64 "entering" DA_Name NULL NULL NULL 0 20008 ##Exit $$00000000 64 64 "exiting" NULL NULL NULL NULL ANSTVC_9 20009 ##GetOff $$00001001 64 64 "getting off" DA_Name NULL NULL NULL 0 20010 ##Look $$00000000 64 64 "looking" NULL NULL NULL NULL ANSTVC_11 20011 ##Examine $$00001100 64 64 "examining" DA_Name NULL NULL NULL 0 20012 ##LookUnder $$00001100 64 64 "looking under" DA_Name NULL NULL NULL 0 20013 ##Search $$00001101 64 64 "searching" DA_Name NULL NULL NULL 0 20014 ##Consult $$00011001 64 78 "consulting" DA_Name "about" DA_Topic NULL 0 20015 ##Lock $$10011011 64 64 "locking" DA_Name "with" DA_Name NULL 0 20016 ##Unlock $$10011011 64 64 "unlocking" DA_Name "with" DA_Name NULL 0 20017 ##SwitchOn $$00001001 64 64 "switching on" DA_Name NULL NULL NULL 0 20018 ##SwitchOff $$00001001 64 64 "switching off" DA_Name NULL NULL NULL 0 20019 ##Open $$00001001 64 64 "opening" DA_Name NULL NULL NULL 0 20020 ##Close $$00001001 64 64 "closing" DA_Name NULL NULL NULL 0 20021 ##Wear $$01001001 64 64 "wearing" DA_Name NULL NULL NULL 0 20022 ##Disrobe $$01001001 64 64 "taking off" DA_Name NULL NULL NULL 0 20023 ##Give $$01011011 64 64 "giving" DA_Name "to" DA_Name NULL 0 20024 ##Show $$01011001 64 64 "showing" DA_Name "to" DA_Name NULL 0 20025 ##WakeOther $$00001001 64 64 "waking" DA_Name NULL NULL NULL 0 20026 ##ThrowAt $$01011001 64 64 "throwing" DA_Name "at" DA_Name NULL 0 20027 ##Attack $$00001001 64 64 "attacking" DA_Name NULL NULL NULL 0 20028 ##Kiss $$00001001 64 64 "kissing" DA_Name NULL NULL NULL 0 20029 ##Answer $$00011001 64 78 "answering" DA_Name "that" DA_Topic NULL 0 20030 ##Tell $$00011001 64 78 "telling" DA_Name "about" DA_Topic NULL 0 20031 ##Ask $$00011001 64 78 "asking" DA_Name "about" DA_Topic NULL 0 20032 ##AskFor $$00011011 64 64 "asking" DA_Name "for" DA_Name NULL 0 20033 ##Wait $$00000000 64 64 "waiting" NULL NULL NULL NULL 0 20034 ##Touch $$00001001 64 64 "touching" DA_Name NULL NULL NULL 0 20035 ##Wave $$00001001 64 64 "waving" DA_Name NULL NULL NULL 0 20036 ##Pull $$00001001 64 64 "pulling" DA_Name NULL NULL NULL 0 20037 ##Push $$00001001 64 64 "pushing" DA_Name NULL NULL NULL 0 20038 ##Turn $$00001001 64 64 "turning" DA_Name NULL NULL NULL 0 20039 ##PushDir $$00011001 64 64 "pushing" DA_Name "to" DA_Name NULL 0 20040 ##Squeeze $$00001001 64 64 "squeezing" DA_Name NULL NULL NULL 0 20041 ##Yes $$00000000 64 64 "saying yes" NULL NULL NULL NULL 0 20042 ##No $$00000000 64 64 "saying no" NULL NULL NULL NULL 0 20043 ##Burn $$00001001 64 64 "burning" DA_Name NULL NULL NULL 0 20044 ##Wake $$00000000 64 64 "waking up" NULL NULL NULL NULL 0 20045 ##Think $$00000000 64 64 "thinking" NULL NULL NULL NULL 0 20046 ##Smell $$00001001 64 64 "smelling" DA_Name NULL NULL NULL 0 20047 ##Listen $$00001001 64 64 "listening to" DA_Name NULL NULL NULL 0 20048 ##Taste $$00001001 64 64 "tasting" DA_Name NULL NULL NULL 0 20049 ##Cut $$00001001 64 64 "cutting" DA_Name NULL NULL NULL 0 20050 ##Jump $$00000000 64 64 "jumping" NULL NULL NULL NULL 0 20051 ##Tie $$00011011 64 64 "tying" DA_Name "to" DA_Name NULL 0 20052 ##Drink $$00001001 64 64 "drinking" DA_Name NULL NULL NULL 0 20053 ##Sorry $$00000000 64 64 "saying sorry" NULL NULL NULL NULL 0 20054 ##Strong $$00000000 64 64 "swearing obscenely" NULL NULL NULL NULL 0 20055 ##Mild $$00000000 64 64 "swearing mildly" NULL NULL NULL NULL 0 20056 ##Swing $$00001001 64 64 "swinging" DA_Name NULL NULL NULL 0 20057 ##Rub $$00001001 64 64 "rubbing" DA_Name NULL NULL NULL 0 20058 ##SetTo $$00011001 64 78 "setting" DA_Name "to" DA_Topic NULL 0 20059 ##WaveHands $$00000000 64 64 "waving hands" NULL NULL NULL NULL 0 20060 ##Buy $$00001001 64 64 "buying" DA_Name NULL NULL NULL 0 20061 ##Sing $$00000000 64 64 "singing" NULL NULL NULL NULL 0 20062 ##Climb $$00001001 64 64 "climbing" DA_Name NULL NULL NULL 0 20063 ##Sleep $$00000000 64 64 "sleeping" NULL NULL NULL NULL 0 20064 ##Quit $$00100000 64 64 "quitting the game" NULL NULL NULL NULL 0 20065 ##Save $$00100000 64 64 "saving the game" NULL NULL NULL NULL 0 20066 ##Restore $$00100000 64 64 "restoring the game" NULL NULL NULL NULL 0 20067 ##Restart $$00100000 64 64 "restarting the game" NULL NULL NULL NULL 0 20068 ##Verify $$00100000 64 64 "verifying the story file" NULL NULL NULL NULL 0 20069 ##ScriptOn $$00100000 64 64 "switching the story transcript on" NULL NULL NULL NULL 0 20070 ##ScriptOff $$00100000 64 64 "switching the story transcript off" NULL NULL NULL NULL 0 20071 ##Version $$00100000 64 64 "requesting the story file version" NULL NULL NULL NULL 0 20072 ##Score $$00100000 64 64 "requesting the score" NULL NULL NULL NULL 0 20073 ##LMode3 $$00100000 64 64 "preferring abbreviated room descriptions" NULL NULL NULL NULL 0 20074 ##LMode2 $$00100000 64 64 "preferring unabbreviated room descriptions" NULL NULL NULL NULL 0 20075 ##LMode1 $$00100000 64 64 "preferring sometimes abbreviated room descriptions" NULL NULL NULL NULL 0 20076 ##NotifyOn $$00100000 64 64 "switching score notification on" NULL NULL NULL NULL 0 20077 ##NotifyOff $$00100000 64 64 "switching score notification off" NULL NULL NULL NULL 0 20078 ##Pronouns $$00100000 64 64 "requesting the pronoun meanings" NULL NULL NULL NULL 0 20079 ##A80_finding_responses_to $$00001000 101 64 "finding responses to" T47_chat_node NULL NULL NULL 0 20080 ##A81_giving_text_for $$00001000 101 64 "giving text for" T47_chat_node NULL NULL NULL 0 20081 ##A82_giving_link_to $$00001000 101 64 "giving link to" T47_chat_node NULL NULL NULL 0 20082 ##A83_preparing $$00001000 101 64 "preparing" T47_chat_node NULL NULL NULL 0 20083 ##A84_switching_the_numbers_of $$00100000 64 64 "switching the numbers off" NULL NULL NULL NULL 0 20084 ##A85_switching_the_numbers_on $$00100000 64 64 "switching the numbers on" NULL NULL NULL NULL 0 20085 ##A86_concentrating $$00000000 64 64 "concentrating" NULL NULL NULL NULL 0 20086 ##A87_parrying $$00000000 64 64 "parrying" NULL NULL NULL NULL 0 20087 ##A88_dodging $$00000000 64 64 "dodging" NULL NULL NULL NULL 0 20088 ##A89_readying $$00001001 64 64 "readying" DA_Name NULL NULL NULL 0 20089 ##A90_reloading $$01001001 64 64 "reloading" DA_Name NULL NULL NULL 0 20090 ##A91_charging $$00001001 64 64 "charging" DA_Name NULL NULL NULL 0 20091 ; [ ANSTVC_7 pos state; if (state == 1) { MStack-->pos = O37_your_room ; pos++; MStack-->pos = nothing ; pos++; MStack-->pos = nothing ; pos++; MStack-->pos = nothing ; pos++; MStack-->pos = nothing ; pos++; } else { pos++; pos++; pos++; pos++; pos++; } return 5; ]; [ ANSTVC_9 pos state; if (state == 1) { MStack-->pos = nothing ; pos++; } else { pos++; } return 1; ]; [ ANSTVC_11 pos state; if (state == 1) { MStack-->pos = ##Wait ; pos++; MStack-->pos = false ; pos++; MStack-->pos = 0 ; pos++; MStack-->pos = nothing ; pos++; } else { pos++; pos++; pos++; pos++; } return 4; ]; Array ActionCoding --> ##Inv ##Take ##Remove ##Drop ##PutOn ##Insert ##Eat ##Go ##Enter ##Exit ##GetOff ##Look ##Examine ##LookUnder ##Search ##Consult ##Lock ##Unlock ##SwitchOn ##SwitchOff ##Open ##Close ##Wear ##Disrobe ##Give ##Show ##WakeOther ##ThrowAt ##Attack ##Kiss ##Answer ##Tell ##Ask ##AskFor ##Wait ##Touch ##Wave ##Pull ##Push ##Turn ##PushDir ##Squeeze ##Yes ##No ##Burn ##Wake ##Think ##Smell ##Listen ##Taste ##Cut ##Jump ##Tie ##Drink ##Sorry ##Strong ##Mild ##Swing ##Rub ##SetTo ##WaveHands ##Buy ##Sing ##Climb ##Sleep ##Quit ##Save ##Restore ##Restart ##Verify ##ScriptOn ##ScriptOff ##Version ##Score ##LMode3 ##LMode2 ##LMode1 ##NotifyOn ##NotifyOff ##Pronouns ##A80_finding_responses_to ##A81_giving_text_for ##A82_giving_link_to ##A83_preparing ##A84_switching_the_numbers_of ##A85_switching_the_numbers_on ##A86_concentrating ##A87_parrying ##A88_dodging ##A89_readying ##A90_reloading ##A91_charging; Array ActionHappened --> 0 0 0 0 0 0; [ InvSub; return GenericVerbSub(123,124,125); ]; [ TakeSub; return GenericVerbSub(126,127,128); ]; [ RemoveSub; return GenericVerbSub(129,130,131); ]; [ DropSub; return GenericVerbSub(132,133,134); ]; [ PutOnSub; return GenericVerbSub(135,136,137); ]; [ InsertSub; return GenericVerbSub(138,139,140); ]; [ EatSub; return GenericVerbSub(141,142,143); ]; [ GoSub; return GenericVerbSub(144,145,146); ]; [ EnterSub; return GenericVerbSub(147,148,149); ]; [ ExitSub; return GenericVerbSub(150,151,152); ]; [ GetOffSub; return GenericVerbSub(153,154,155); ]; [ LookSub; return GenericVerbSub(156,157,158); ]; [ ExamineSub; return GenericVerbSub(159,160,161); ]; [ LookUnderSub; return GenericVerbSub(162,163,164); ]; [ SearchSub; return GenericVerbSub(165,166,167); ]; [ ConsultSub; return GenericVerbSub(168,169,170); ]; [ LockSub; return GenericVerbSub(171,172,173); ]; [ UnlockSub; return GenericVerbSub(174,175,176); ]; [ SwitchOnSub; return GenericVerbSub(177,178,179); ]; [ SwitchOffSub; return GenericVerbSub(180,181,182); ]; [ OpenSub; return GenericVerbSub(183,184,185); ]; [ CloseSub; return GenericVerbSub(186,187,188); ]; [ WearSub; return GenericVerbSub(189,190,191); ]; [ DisrobeSub; return GenericVerbSub(192,193,194); ]; [ GiveSub; return GenericVerbSub(195,196,197); ]; [ ShowSub; return GenericVerbSub(198,199,200); ]; [ WakeOtherSub; return GenericVerbSub(201,202,203); ]; [ ThrowAtSub; return GenericVerbSub(204,205,206); ]; [ AttackSub; return GenericVerbSub(207,208,209); ]; [ KissSub; return GenericVerbSub(210,211,212); ]; [ AnswerSub; return GenericVerbSub(213,214,215); ]; [ TellSub; return GenericVerbSub(216,217,218); ]; [ AskSub; return GenericVerbSub(219,220,221); ]; [ AskForSub; return GenericVerbSub(222,223,224); ]; [ WaitSub; return GenericVerbSub(225,226,227); ]; [ TouchSub; return GenericVerbSub(228,229,230); ]; [ WaveSub; return GenericVerbSub(231,232,233); ]; [ PullSub; return GenericVerbSub(234,235,236); ]; [ PushSub; return GenericVerbSub(237,238,239); ]; [ TurnSub; return GenericVerbSub(240,241,242); ]; [ PushDirSub; return GenericVerbSub(243,244,245); ]; [ SqueezeSub; return GenericVerbSub(246,247,248); ]; [ YesSub; return GenericVerbSub(249,250,251); ]; [ NoSub; return GenericVerbSub(252,253,254); ]; [ BurnSub; return GenericVerbSub(255,256,257); ]; [ WakeSub; return GenericVerbSub(258,259,260); ]; [ ThinkSub; return GenericVerbSub(261,262,263); ]; [ SmellSub; return GenericVerbSub(264,265,266); ]; [ ListenSub; return GenericVerbSub(267,268,269); ]; [ TasteSub; return GenericVerbSub(270,271,272); ]; [ CutSub; return GenericVerbSub(273,274,275); ]; [ JumpSub; return GenericVerbSub(276,277,278); ]; [ TieSub; return GenericVerbSub(279,280,281); ]; [ DrinkSub; return GenericVerbSub(282,283,284); ]; [ SorrySub; return GenericVerbSub(285,286,287); ]; [ StrongSub; return GenericVerbSub(288,289,290); ]; [ MildSub; return GenericVerbSub(291,292,293); ]; [ SwingSub; return GenericVerbSub(294,295,296); ]; [ RubSub; return GenericVerbSub(297,298,299); ]; [ SetToSub; return GenericVerbSub(300,301,302); ]; [ WaveHandsSub; return GenericVerbSub(303,304,305); ]; [ BuySub; return GenericVerbSub(306,307,308); ]; [ SingSub; return GenericVerbSub(309,310,311); ]; [ ClimbSub; return GenericVerbSub(312,313,314); ]; [ SleepSub; return GenericVerbSub(315,316,317); ]; [ QuitSub; return GenericVerbSub(318,319,320); ]; [ SaveSub; return GenericVerbSub(321,322,323); ]; [ RestoreSub; return GenericVerbSub(324,325,326); ]; [ RestartSub; return GenericVerbSub(327,328,329); ]; [ VerifySub; return GenericVerbSub(330,331,332); ]; [ ScriptOnSub; return GenericVerbSub(333,334,335); ]; [ ScriptOffSub; return GenericVerbSub(336,337,338); ]; [ VersionSub; return GenericVerbSub(339,340,341); ]; [ ScoreSub; return GenericVerbSub(342,343,344); ]; [ LMode3Sub; return GenericVerbSub(345,346,347); ]; [ LMode2Sub; return GenericVerbSub(348,349,350); ]; [ LMode1Sub; return GenericVerbSub(351,352,353); ]; [ NotifyOnSub; return GenericVerbSub(354,355,356); ]; [ NotifyOffSub; return GenericVerbSub(357,358,359); ]; [ PronounsSub; return GenericVerbSub(360,361,362); ]; [ A80_finding_responses_toSub; return GenericVerbSub(363,364,365); ]; [ A81_giving_text_forSub; return GenericVerbSub(366,367,368); ]; [ A82_giving_link_toSub; return GenericVerbSub(369,370,371); ]; [ A83_preparingSub; return GenericVerbSub(372,373,374); ]; [ A84_switching_the_numbers_ofSub; return GenericVerbSub(375,376,377); ]; [ A85_switching_the_numbers_onSub; return GenericVerbSub(378,379,380); ]; [ A86_concentratingSub; return GenericVerbSub(402,403,404); ]; [ A87_parryingSub; return GenericVerbSub(405,406,407); ]; [ A88_dodgingSub; return GenericVerbSub(408,409,410); ]; [ A89_readyingSub; return GenericVerbSub(416,417,418); ]; [ A90_reloadingSub; return GenericVerbSub(424,425,426); ]; [ A91_chargingSub; return GenericVerbSub(427,428,429); ]; [ MistakeActionSub; switch(understand_as_mistake_number) { default: "I didn't understand that sentence."; } say__p = 1; ]; ! Definitions of non-inline "To..." phrases ! To blank out the AI Combat Person Options: [ PHR_879 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of ai combat person options begin] @push ct_0; @push ct_1; for (t_0=T6_ai_combat_person_options,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 2 ! [2: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 3 ! [3: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [3: end repeat]^"; rfalse; ]; ! To blank out the AI Combat Weapon Options: [ PHR_880 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of ai combat weapon options begin] @push ct_0; @push ct_1; for (t_0=T8_ai_combat_weapon_options,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 2 ! [2: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 3 ! [3: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [3: end repeat]^"; rfalse; ]; ! To calculate the final damage ( attacker - a person ) does against ( defender - a person ): [ PHR_851 t_0 ! Call parameter 'attacker' = OBJECT_TY t_1 ! Call parameter 'defender' = OBJECT_TY ; ! phrase 1 ! [1: continue the activity] rfalse; rfalse; ]; ! From the Standard Rules ! To set the/-- locale priority of ( O - an object ) to ( N - a number ): [ PHR_57 t_0 ! Call parameter 'O' = OBJECT_TY t_1 ! Call parameter 'N' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: if o is a thing begin] if (((t_0 ofclass K2_thing))) { ! phrase 2 ! [2: if n <= 0 , now o is mentioned] if (((t_1 <= 0))) { Adj_48_t2_v64(t_0); } ! phrase 3 ! [3: if there is a notable-object of o in the table of locale priorities begin] if (( (ExistsTableLookUpCorr(T1_locale_priorities,105,105,t_0)) )) { ! phrase 4 ! [4: choose row with a notable-object of o in the table of locale priorities] ct_0 = T1_locale_priorities; ct_1 = TableRowCorr(ct_0, 105, t_0); ! phrase 5 ! [5: if n <= 0 , blank out the whole row] if (((t_1 <= 0))) { TableBlankOutRow(ct_0, ct_1); } ! phrase 6 ! [6: otherwise change the locale description priority entry to n] else { TableLookUpEntry(ct_0,106,ct_1,1,t_1); } ! phrase 7 ! [7: otherwise] } else { ! phrase 8 ! [8: if n is greater than 0 begin] if (((t_1 > 0))) { ! phrase 9 ! [9: choose a blank row in the table of locale priorities] ct_0 = T1_locale_priorities; ct_1 = TableBlankRow(ct_0); ! phrase 10 ! [10: change the notable-object entry to o] TableLookUpEntry(ct_0,105,ct_1,1,t_0); ! phrase 11 ! [11: change the locale description priority entry to n] TableLookUpEntry(ct_0,106,ct_1,1,t_1); ! phrase 12 ! [12: end if] } ! phrase 13 ! [13: end if] } ! phrase 14 ! [14: end if] } rfalse; ]; ! To blank out the AI Combat Options: [ PHR_878 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of ai combat options begin] @push ct_0; @push ct_1; for (t_0=T7_ai_combat_options,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 2 ! [2: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 3 ! [3: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [3: end repeat]^"; rfalse; ]; ! To have the AI select a target: [ PHR_881 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: blank out the ai combat person options] (PHR_879()); ! phrase 2 ! [2: now the found-a-target boolean is false] (Global_Vars-->77) = 0; ! phrase 3 ! [3: repeat with x running through all alive persons enclosed by the location begin] for (t_0=Prop_0(0), t_1=Prop_0(t_0): t_0: t_0=t_1, t_1=Prop_0(t_1)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_0, "]^"; ! phrase 4 ! [4: if the hostility of x is not neutral begin] if ((~~((ValueProperty(t_0,p74_hostility) == Q69_neutral)))) { ! phrase 5 ! [5: if the hostility of x is not the hostility of the global attacker begin] if ((~~((ValueProperty(t_0,p74_hostility) == ValueProperty((Global_Vars-->63),p74_hostility))))) { ! phrase 6 ! [6: now the found-a-target boolean is true] (Global_Vars-->77) = 1; ! phrase 7 ! [7: choose a blank row in the table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = TableBlankRow(ct_0); ! phrase 8 ! [8: change person option entry to x] TableLookUpEntry(ct_0,115,ct_1,1,t_0); ! phrase 9 ! [9: change weight entry to 0] TableLookUpEntry(ct_0,116,ct_1,1,0); ! phrase 10 ! [10: now stored_row is the current_row] (Global_Vars-->73) = ct_1 ; ! phrase 11 ! [11: now stored_person is x] (Global_Vars-->74) = t_0; ! phrase 12 ! [12: consider the standard ai target select rules] ProcessRulebook(411); ! phrase 13 ! [13: end if] } ! phrase 14 ! [14: end if] } ! phrase 15 ! [15: end repeat] } if (debug_rules>1) print " [15: end repeat]^"; ! phrase 16 ! [16: if the found-a-target boolean is true begin] if ((((Global_Vars-->77) == 1))) { ! phrase 17 ! [17: sort the table of ai combat person options in random order] TableShuffle(T6_ai_combat_person_options); ! phrase 18 ! [18: sort the table of ai combat person options in reverse weight order] TableSort(T6_ai_combat_person_options, 116, -1); ! phrase 19 ! [19: choose row one in the table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = 1; ! phrase 20 ! [20: now the global defender is the person option entry] (Global_Vars-->64) = TableLookUpEntry(ct_0,115,ct_1); ! phrase 21 ! [21: end if] } rfalse; ]; ! To have the AI select a weapon: [ PHR_892 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: blank out the ai combat weapon options] (PHR_880()); ! phrase 2 ! [2: repeat with x running through all weapons enclosed by the global attacker begin] for (t_0=Prop_1(0), t_1=Prop_1(t_0): t_0: t_0=t_1, t_1=Prop_1(t_1)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_0, "]^"; ! phrase 3 ! [3: choose a blank row in the table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = TableBlankRow(ct_0); ! phrase 4 ! [4: change weapon option entry to x] TableLookUpEntry(ct_0,118,ct_1,1,t_0); ! phrase 5 ! [5: change weight entry to 0] TableLookUpEntry(ct_0,116,ct_1,1,0); ! phrase 6 ! [6: now stored_row is the current_row] (Global_Vars-->73) = ct_1 ; ! phrase 7 ! [7: now stored_weapon is x] (Global_Vars-->75) = t_0; ! phrase 8 ! [8: consider the standard ai weapon select rules] ProcessRulebook(412); ! phrase 9 ! [9: end repeat] } if (debug_rules>1) print " [9: end repeat]^"; ! phrase 10 ! [10: sort the table of ai combat weapon options in random order] TableShuffle(T8_ai_combat_weapon_options); ! phrase 11 ! [11: sort the table of ai combat weapon options in reverse weight order] TableSort(T8_ai_combat_weapon_options, 116, -1); ! phrase 12 ! [12: choose row one in the table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = 1; ! phrase 13 ! [13: now the stored_weapon is the weapon option entry] (Global_Vars-->75) = TableLookUpEntry(ct_0,118,ct_1); rfalse; ]; ! To have the AI select an action: [ PHR_902 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: blank out the ai combat options] (PHR_878()); ! phrase 2 ! [2: consider the standard ai action select rules] ProcessRulebook(413); ! phrase 3 ! [3: sort the table of ai combat options in random order] TableShuffle(T7_ai_combat_options); ! phrase 4 ! [4: sort the table of ai combat options in reverse weight order] TableSort(T7_ai_combat_options, 116, -1); ! phrase 5 ! [5: choose row one in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = 1; ! phrase 6 ! [6: now the stored_action is the option entry] BlkValueCopy((Global_Vars-->76), TableLookUpEntry(ct_0,117,ct_1)); rfalse; ]; ! To make ( attacker - a person ) strike a blow against ( defender - a person ): [ PHR_838 t_0 ! Call parameter 'attacker' = OBJECT_TY t_1 ! Call parameter 'defender' = OBJECT_TY ; ! phrase 1 ! [1: now the global attacker is the attacker] (Global_Vars-->63) = t_0; ! phrase 2 ! [2: now the global defender is the defender] (Global_Vars-->64) = t_1; ! phrase 3 ! [3: have the global attacker start pressing the global defender] (PHR_825((Global_Vars-->63),(Global_Vars-->64))); ! phrase 4 ! [4: now the global attacker weapon is a random readied weapon enclosed by the global attacker] (Global_Vars-->65) = (Prop_2()) ; ! phrase 5 ! [5: now the global defender weapon is a random readied weapon enclosed by the global defender] (Global_Vars-->66) = (Prop_3()) ; ! phrase 6 ! [6: consider the reset combat variables rules] ProcessRulebook(381); ! phrase 7 ! [7: abide by the whether attacking begins rules] if (ProcessRulebook(382)) rtrue; ! phrase 8 ! [8: consider the preliminary results of attacking rules] ProcessRulebook(383); ! phrase 9 ! [9: consider the basic attack roll rules] ProcessRulebook(384); ! phrase 10 ! [10: consider the whether attack modifiers apply rules] ProcessRulebook(385); ! phrase 11 ! [11: if rule succeeded , consider the attack modifiers rules] if (( (RulebookSucceeded()) )) { ProcessRulebook(386); } ! phrase 12 ! [12: consider the always-present attack modifiers rules] ProcessRulebook(387); ! phrase 13 ! [13: consider the show results of the attack roll rules] ProcessRulebook(388); ! phrase 14 ! [14: consider the whether the attack hit rules] ProcessRulebook(389); ! phrase 15 ! [15: if rule succeeded begin] if (( (RulebookSucceeded()) )) { ! phrase 16 ! [16: consider the immediate results of hitting rules] ProcessRulebook(390); ! phrase 17 ! [17: consider the basic damage roll rules] ProcessRulebook(391); ! phrase 18 ! [18: consider the damage modifiers rules] ProcessRulebook(392); ! phrase 19 ! [19: if the damage is greater than 0 , consider the final damage rules] if ((((Global_Vars-->69) > 0))) { ProcessRulebook(394); } ! phrase 20 ! [20: consider the printing-the-damage rules] ProcessRulebook(393); ! phrase 21 ! [21: if the final damage is 0 , consider the report no final damage rules] if ((((Global_Vars-->71) == 0))) { ProcessRulebook(395); } ! phrase 22 ! [22: if the final damage is greater than 0 begin] if ((((Global_Vars-->71) > 0))) { ! phrase 23 ! [23: if the final damage is less than the health of the global defender begin] if ((((Global_Vars-->71) < ValueProperty((Global_Vars-->64),p10_health)))) { ! phrase 24 ! [24: consider the non-fatal damage rules] ProcessRulebook(396); ! phrase 25 ! [25: otherwise] } else { ! phrase 26 ! [26: consider the fatal damage rules] ProcessRulebook(397); ! phrase 27 ! [27: end if] } ! phrase 28 ! [28: end if] } ! phrase 29 ! [29: end if] } ! phrase 30 ! [30: consider the print flavour text rules] ProcessRulebook(399); ! phrase 31 ! [31: if the player is not killed , consider the aftereffects rulebook] if ((~~((Adj_21_t1_v64(player))))) { ProcessRulebook(400); } ! phrase 32 ! [32: consider the take away until attack bonuses rulebook] ProcessRulebook(398); ! phrase 33 ! [33: consider the final blow report rulebook] ProcessRulebook(401); rfalse; ]; ! To let ( the defender - a person ) lose concentration between brackets: [ PHR_867 t_0 ! Call parameter 'defender' = OBJECT_TY ; ! phrase 1 ! [1: if the concentration of the defender is 0 , continue the activity] if (((ValueProperty(t_0,p17_concentration) == 0))) { rfalse; } ! phrase 2 ! [2: now the concentration of the defender is 0] WriteValueProperty(t_0,p17_concentration,0); ! phrase 3 ! [3: if the defender is the player , say ~(making you lose your [bold type]concentration[roman type])[run paragraph on]~] if (((t_0 == player))) { say__p=1;ParaContent(); print (PrintText) SC_15; ParaContent(); style bold; ParaContent(); print (PrintText) SC_16; ParaContent(); style roman; ParaContent(); print (PrintText) SC_17; ParaContent(); RunParagraphOn(); .L_Say0; .L_SayX0; } ! phrase 4 ! [4: if the defender is not the player , say ~(making [the defender] lose [bold type]concentration[roman type])[run paragraph on]~] if ((~~((t_0 == player)))) { say__p=1;ParaContent(); print (PrintText) SC_18; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_19; ParaContent(); style bold; ParaContent(); print (PrintText) SC_16; ParaContent(); style roman; ParaContent(); print (PrintText) SC_17; ParaContent(); RunParagraphOn(); .L_Say1; .L_SayX1; } rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To decide whether exiting on zero is allowed: [ PHR_707 ; ! phrase 1 ! [1: if current exiting is player may exit upon zero , decide yes] if ((((Global_Vars-->47) == Q50_player_may_exit_upon_zer))) { rtrue; } ! phrase 2 ! [2: decide no] rfalse; rfalse; ]; ! From the Standard Rules ! To decide if intervened in miscellaneous list message: [ PHR_683 ; ! phrase 1 ! [1: decide on false] return 0; rfalse; ]; ! To set up the combat order: [ PHR_832 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_2 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_3 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of combat order begin] @push ct_0; @push ct_1; for (t_0=T4_combat_order,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 2 ! [2: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 3 ! [3: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [3: end repeat]^"; ! phrase 4 ! [4: repeat with x running through all alive persons enclosed by the location begin] for (t_2=Prop_4(0), t_3=Prop_4(t_2): t_2: t_2=t_3, t_3=Prop_4(t_3)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_2, "]^"; ! phrase 5 ! [5: choose a blank row in table of combat order] ct_0 = T4_combat_order; ct_1 = TableBlankRow(ct_0); ! phrase 6 ! [6: now the combatant entry is x] TableLookUpEntry(ct_0,111,ct_1,1,t_2); ! phrase 7 ! [7: now the move order entry is the number of persons pressing x] TableLookUpEntry(ct_0,112,ct_1,1, (Prop_5(,t_2)) ); ! phrase 8 ! [8: decrease the move order entry by the initiative modifier of x] TableLookUpEntry(ct_0,112,ct_1,3,ValueProperty(t_2,p16_initiative_modifier)); ! phrase 9 ! [9: increase the move order entry by a random number between 1 and 3] TableLookUpEntry(ct_0,112,ct_1,2, (GenerateRandomNumber(1, 3)) ); ! phrase 10 ! [10: now the combat state of x is none] WriteValueProperty(t_2,p76_combat_state,Q75_none); ! phrase 11 ! [11: now the react state of x is no react] WriteValueProperty(t_2,p77_react_state,Q78_no_react); ! phrase 12 ! [12: now the initiative modifier of x is 0] WriteValueProperty(t_2,p16_initiative_modifier,0); ! phrase 13 ! [13: end repeat] } if (debug_rules>1) print " [13: end repeat]^"; ! phrase 14 ! [14: sort the table of combat order in random order] TableShuffle(T4_combat_order); ! phrase 15 ! [15: sort the table of combat order in move order order] TableSort(T4_combat_order, 112, 1); rfalse; ]; ! From "Basic Screen Effects" by Emily Short ! To fill status bar with ( selected table - a table-name ): [ PHR_739 t_0 ! Call parameter 'selected table' = TABLE_TY t_1 ! Local variable e.g. '__n' = NUMBER_TY t_2 ! Local variable e.g. '__index' = NUMBER_TY t_3 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_4 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: let __n be the number of rows in the selected table] t_1 = TableRows(t_0) ; ! phrase 2 ! [2: deepen status line to __n rows] DeepStatus(t_1); ! phrase 3 ! [3: let __index be 1] t_2 = 1; ! phrase 4 ! [4: repeat through selected table begin] @push ct_0; @push ct_1; for (t_3=t_0,t_4=1,ct_0=t_3,ct_1=t_4: t_4<=TableRows(t_3):t_4++,ct_0=t_3,ct_1=t_4) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 5 ! [5: move cursor to __index] I7VM_MoveCursorInStatusLine(t_2); ! phrase 6 ! [6: say ~[left entry]~] say__p=1;ParaContent(); print (PrintText) TableLookUpEntry(ct_0,108,ct_1); .L_Say2; .L_SayX2; ! phrase 7 ! [7: center central entry at row __index] CenterPrint(TableLookUpEntry(ct_0,109,ct_1), t_2); ! phrase 8 ! [8: right align cursor to __index] RightAlign(t_2); ! phrase 9 ! [9: say ~[right entry]~] say__p=1;ParaContent(); print (PrintText) TableLookUpEntry(ct_0,110,ct_1); .L_Say3; .L_SayX3; ! phrase 10 ! [10: change __index to __index + 1] t_2 = (t_2+1) ; ! phrase 11 ! [11: end repeat] } @pull ct_1; @pull ct_0; rfalse; ]; ! From "Plurality" by Emily Short ! To have the parser notice ( o - an object ): [ PHR_797 t_0 ! Call parameter 'o' = OBJECT_TY ; ! phrase 1 ! [1: if o is ambiguously plural , notice the plurality of o] if (((Adj_67_t1_v64(t_0)))) { PlugPlural(t_0); } ! phrase 2 ! [2: otherwise notice o boringly] else { PronounNotice(t_0); } rfalse; ]; ! To restore the health of ( patient - a person ): [ PHR_822 t_0 ! Call parameter 'patient' = OBJECT_TY ; ! phrase 1 ! [1: change the health of the patient to the permanent health of the patient] WriteValueProperty(t_0,p10_health,ValueProperty(t_0,p11_permanent_health)); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To run a conversation from ( current node - a chat node ): [ PHR_718 t_0 ! Call parameter 'current node' = t_1 ! Local variable e.g. 'previous node' = t_2 ! Local variable e.g. 'next node' = t_3 ! Local variable e.g. 'choice made' = NUMBER_TY ; ! phrase 1 ! [1: let previous node be no quip chosen] t_1 = Q53_no_quip_chosen; ! phrase 2 ! [2: let next node be no quip chosen] t_2 = Q53_no_quip_chosen; ! phrase 3 ! [3: while current node is not no quip chosen begin] while ((~~((t_0 == Q53_no_quip_chosen)))) { ! phrase 4 ! [4: if using the default forbid exiting conversations option begin] if (( (TestUseOption(18)) )) { ! phrase 5 ! [5: forbid exiting on zero] (PHR_706()); ! phrase 6 ! [6: otherwise] } else { ! phrase 7 ! [7: allow exiting on zero] (PHR_705()); ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: try giving text for current node] TryAction(0, player, ##A81_giving_text_for, t_0, 0);; ! phrase 10 ! [10: reset the links] (PHR_713()); ! phrase 11 ! [11: try silently finding responses to current node] @push keep_silent; keep_silent=1; TryAction(0, player, ##A80_finding_responses_to, t_0, 0);; @pull keep_silent; ! phrase 12 ! [12: if rowcount is greater than 0 begin] if ((((Global_Vars-->48) > 0))) { ! phrase 13 ! [13: repeat with current row running from 1 to rowcount begin] for (t_3=1: t_3<=(Global_Vars-->48): t_3++) { ! phrase 14 ! [14: say ~[current row]) [run paragraph on]~] say__p=1;ParaContent(); print (say__n=t_3); ParaContent(); print (PrintText) SC_20; ParaContent(); RunParagraphOn(); .L_Say4; .L_SayX4; ! phrase 15 ! [15: change next node to result in row current row of table of current choices] t_2 = TableLookUpEntry(T2_current_choices,107,t_3); ! phrase 16 ! [16: change first chat node to next node] (Global_Vars-->49) = t_2; ! phrase 17 ! [17: change second chat node to current node] (Global_Vars-->50) = t_0; ! phrase 18 ! [18: try giving link to next node] TryAction(0, player, ##A82_giving_link_to, t_2, 0);; ! phrase 19 ! [19: end repeat] } ! phrase 20 ! [20: let choice made be 0] t_3 = 0; ! phrase 21 ! [21: if exiting on zero is allowed begin] if (((PHR_707()))) { ! phrase 22 ! [22: say ~(or 0 to say nothing)~] say__p=1;ParaContent(); print (PrintText) SC_21; .L_Say5; .L_SayX5; ! phrase 23 ! [23: change choice made to the choice made from 0 to rowcount] t_3 = ReadChoice ( 0, (Global_Vars-->48) ) ; ! phrase 24 ! [24: otherwise] } else { ! phrase 25 ! [25: change choice made to the choice made from 1 to rowcount] t_3 = ReadChoice ( 1, (Global_Vars-->48) ) ; ! phrase 26 ! [26: end if] } ! phrase 27 ! [27: if choice made is 0 begin] if (((t_3 == 0))) { ! phrase 28 ! [28: change next node to no quip chosen] t_2 = Q53_no_quip_chosen; ! phrase 29 ! [29: otherwise] } else { ! phrase 30 ! [30: change next node to result in row choice made of table of current choices] t_2 = TableLookUpEntry(T2_current_choices,107,t_3); ! phrase 31 ! [31: end if] } ! phrase 32 ! [32: change previous node to current node] t_1 = t_0; ! phrase 33 ! [33: change current node to next node] t_0 = t_2; ! phrase 34 ! [34: otherwise] } else { ! phrase 35 ! [35: change current node to no quip chosen] t_0 = Q53_no_quip_chosen; ! phrase 36 ! [36: end if] } ! phrase 37 ! [37: end while] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap it-them of ( item - a thing ): [ PHR_785 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~Them~] say__p=1;ParaContent(); print (PrintText) SC_22; .L_Say6; .L_SayX6; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~You~] say__p=1;ParaContent(); print (PrintText) SC_23; .L_Say7; .L_SayX7; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~Him~] say__p=1;ParaContent(); print (PrintText) SC_24; .L_Say8; .L_SayX8; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~Her~] say__p=1;ParaContent(); print (PrintText) SC_25; .L_Say9; .L_SayX9; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~It~] say__p=1;ParaContent(); print (PrintText) SC_26; .L_Say10; .L_SayX10; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap it-they of ( item - a thing ): [ PHR_777 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~They~] say__p=1;ParaContent(); print (PrintText) SC_27; .L_Say11; .L_SayX11; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~You~] say__p=1;ParaContent(); print (PrintText) SC_23; .L_Say12; .L_SayX12; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~He~] say__p=1;ParaContent(); print (PrintText) SC_28; .L_Say13; .L_SayX13; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~She~] say__p=1;ParaContent(); print (PrintText) SC_29; .L_Say14; .L_SayX14; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~It~] say__p=1;ParaContent(); print (PrintText) SC_26; .L_Say15; .L_SayX15; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap its-their of ( item - a thing ): [ PHR_781 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~Their~] say__p=1;ParaContent(); print (PrintText) SC_30; .L_Say16; .L_SayX16; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~Your~] say__p=1;ParaContent(); print (PrintText) SC_31; .L_Say17; .L_SayX17; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~His~] say__p=1;ParaContent(); print (PrintText) SC_32; .L_Say18; .L_SayX18; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~Her~] say__p=1;ParaContent(); print (PrintText) SC_25; .L_Say19; .L_SayX19; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~Its~] say__p=1;ParaContent(); print (PrintText) SC_33; .L_Say20; .L_SayX20; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap its-theirs of ( item - a thing ): [ PHR_789 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~Theirs~] say__p=1;ParaContent(); print (PrintText) SC_34; .L_Say21; .L_SayX21; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~Yours~] say__p=1;ParaContent(); print (PrintText) SC_35; .L_Say22; .L_SayX22; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~His~] say__p=1;ParaContent(); print (PrintText) SC_32; .L_Say23; .L_SayX23; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~Hers~] say__p=1;ParaContent(); print (PrintText) SC_36; .L_Say24; .L_SayX24; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~Its~] say__p=1;ParaContent(); print (PrintText) SC_33; .L_Say25; .L_SayX25; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap possessive of ( item - a thing ): [ PHR_793 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item is the player begin] if (((t_0 == player))) { ! phrase 4 ! [4: say ~Your~] say__p=1;ParaContent(); print (PrintText) SC_31; .L_Say26; .L_SayX26; ! phrase 5 ! [5: otherwise if the item acts plural] } else if (( (t_0 has pluralname) )) { ! phrase 6 ! [6: say ~[The item][apostrophe]~] say__p=1;ParaContent(); print (The) t_0; ParaContent(); print "'"; .L_Say27; .L_SayX27; ! phrase 7 ! [7: otherwise] } else { ! phrase 8 ! [8: say ~[The item][apostrophe]s~] say__p=1;ParaContent(); print (The) t_0; ParaContent(); print "'"; ParaContent(); print (PrintText) SC_37; .L_Say28; .L_SayX28; ! phrase 9 ! [9: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap that-those of ( item - a thing ): [ PHR_773 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~Those~] say__p=1;ParaContent(); print (PrintText) SC_38; .L_Say29; .L_SayX29; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~You~] say__p=1;ParaContent(); print (PrintText) SC_23; .L_Say30; .L_SayX30; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~He~] say__p=1;ParaContent(); print (PrintText) SC_28; .L_Say31; .L_SayX31; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~She~] say__p=1;ParaContent(); print (PrintText) SC_29; .L_Say32; .L_SayX32; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~That~] say__p=1;ParaContent(); print (PrintText) SC_39; .L_Say33; .L_SayX33; ! phrase 13 ! [13: end if] } rfalse; ]; ! From the Standard Rules ! To say the contents of ( O - an object ): [ PHR_337 t_0 ! Call parameter 'O' = OBJECT_TY ; ! phrase 1 ! [1: list the contents of o , as a sentence , using the definite article] WriteListFrom(child(t_0), 264); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To allow exiting on zero: [ PHR_705 ; ! phrase 1 ! [1: now current exiting is player may exit upon zero] (Global_Vars-->47) = Q50_player_may_exit_upon_zer; rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To forbid exiting on zero: [ PHR_706 ; ! phrase 1 ! [1: now current exiting is player may not exit] (Global_Vars-->47) = Q51_player_may_not_exit; rfalse; ]; ! From the Standard Rules ! To decide if intervened in action message: [ PHR_684 ; ! phrase 1 ! [1: decide on false] return 0; rfalse; ]; ! From the Standard Rules ! To decide if intervened in miscellaneous message: [ PHR_682 ; ! phrase 1 ! [1: decide on false] return 0; rfalse; ]; ! From the Standard Rules ! To say no line break -- running on: [ PHR_314 ; ! phrase 1 ! [1: do nothing] ; rfalse; ]; ! To test for any key: [ PHR_744 ; ! phrase 1 ! [1: if the test key strokes boolean is true , wait for any key] if ((((Global_Vars-->53) == 1))) { KeyPause(); } rfalse; ]; ! To have ( A - a person ) start pressing ( B - a person ): [ PHR_825 t_0 ! Call parameter 'A' = OBJECT_TY t_1 ! Call parameter 'B' = OBJECT_TY t_2 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_3 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; ! phrase 1 ! [1: repeat with x running through all persons pressed by a begin] for (t_2=Prop_6(,t_0,0), t_3=Prop_6(,t_0,t_2): t_2: t_2=t_3, t_3=Prop_6(,t_0,t_3)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_2, "]^"; ! phrase 2 ! [2: now a does not press x] (Relation_NowNVtoV(t_0,V2V_Bitmap_67,t_2,false)); ! phrase 3 ! [3: end repeat] } if (debug_rules>1) print " [3: end repeat]^"; ! phrase 4 ! [4: now a presses b] (Relation_NowVtoV(t_0,V2V_Bitmap_67,t_1,false)); rfalse; ]; ! To heal ( patient - a person ) for ( health - a number ) health: [ PHR_823 t_0 ! Call parameter 'patient' = OBJECT_TY t_1 ! Call parameter 'health' = NUMBER_TY t_2 ! Local variable e.g. 'health dummy' = NUMBER_TY ; ! phrase 1 ! [1: let the health dummy be the permanent health of the patient minus the health of the patient] t_2 = (ValueProperty(t_0,p11_permanent_health)-ValueProperty(t_0,p10_health)) ; ! phrase 2 ! [2: if health is less than the first dummy , now the health dummy is health] if (((t_1 < (Global_Vars-->58)))) { t_2 = t_1; } ! phrase 3 ! [3: increase the health of the patient by the health dummy] WriteValueProperty(t_0,p10_health,ValueProperty(t_0,p10_health)+t_2); ! phrase 4 ! [4: say the health dummy] say__p=1;ParaContent(); print (say__n=t_2); .L_Say34; .L_SayX34; rfalse; ]; ! From the Standard Rules ! To describe locale for ( O - object ): [ PHR_56 t_0 ! Call parameter 'O' = OBJECT_TY ; ! phrase 1 ! [1: carry out the printing the locale description activity with o] CarryOutActivity(V29_printing_the_locale_desc, t_0); rfalse; ]; ! To let ( the defender - a person ) lose concentration: [ PHR_866 t_0 ! Call parameter 'defender' = OBJECT_TY ; ! phrase 1 ! [1: if the concentration of the defender is 0 , continue the activity] if (((ValueProperty(t_0,p17_concentration) == 0))) { rfalse; } ! phrase 2 ! [2: now the concentration of the defender is 0] WriteValueProperty(t_0,p17_concentration,0); ! phrase 3 ! [3: if the defender is the player , say ~ You lose your [bold type]concentration[roman type]![run paragraph on]~] if (((t_0 == player))) { say__p=1;ParaContent(); print (PrintText) SC_40; ParaContent(); style bold; ParaContent(); print (PrintText) SC_16; ParaContent(); style roman; ParaContent(); print (PrintText) SC_41; ParaContent(); RunParagraphOn(); .L_Say35; .L_SayX35; } ! phrase 4 ! [4: if the defender is not the player , say ~ [The defender] loses [bold type]concentration[roman type]![run paragraph on]~] if ((~~((t_0 == player)))) { say__p=1;ParaContent(); print (PrintText) SC_42; ParaContent(); print (The) t_0; ParaContent(); print (PrintText) SC_43; ParaContent(); style bold; ParaContent(); print (PrintText) SC_16; ParaContent(); style roman; ParaContent(); print (PrintText) SC_41; ParaContent(); RunParagraphOn(); .L_Say36; .L_SayX36; } rfalse; ]; ! From "Plurality" by Emily Short ! To mark ( target - a thing ) in output: [ PHR_754 t_0 ! Call parameter 'target' = OBJECT_TY ; ! phrase 1 ! [1: if the target acts plural or target is the player , mark-future-plural] if ((( (t_0 has pluralname) )) || (((t_0 == player)))) { say__n = 1; } ! phrase 2 ! [2: otherwise mark-future-singular] else { say__n = 29; } ! phrase 3 ! [3: change the prior named noun to the target] (Global_Vars-->54) = t_0; rfalse; ]; ! To receive health for ( the victim - a person ): [ PHR_854 t_0 ! Call parameter 'victim' = OBJECT_TY ; ! phrase 1 ! [1: now the third dummy is the permanent health of the player - the health of the player] (Global_Vars-->60) = (ValueProperty(player,p11_permanent_health)-ValueProperty(player,p10_health)) ; ! phrase 2 ! [2: now the fourth dummy is the gained health of the victim] (Global_Vars-->61) = ValueProperty(t_0,p12_gained_health); ! phrase 3 ! [3: if the fourth dummy is greater than the third dummy , now the fourth dummy is the third dummy] if ((((Global_Vars-->61) > (Global_Vars-->60)))) { (Global_Vars-->61) = (Global_Vars-->60); } ! phrase 4 ! [4: if the fourth dummy is greater than 0 begin] if ((((Global_Vars-->61) > 0))) { ! phrase 5 ! [5: if the numbers boolean is true , say ~ [bold type](Your health increases by ~ , the fourth dummy] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_42; ParaContent(); style bold; ParaContent(); print (PrintText) SC_44; ParaContent(); print (say__n=(Global_Vars-->61)); .L_Say37; .L_SayX37; } ! phrase 6 ! [6: increase the health of the player by the fourth dummy] WriteValueProperty(player,p10_health,ValueProperty(player,p10_health)+(Global_Vars-->61)); ! phrase 7 ! [7: if the numbers boolean is true , say ~.)[roman type][run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_45; ParaContent(); style roman; ParaContent(); RunParagraphOn(); .L_Say38; .L_SayX38; } ! phrase 8 ! [8: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap that-those ( item - a thing ): [ PHR_771 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~Those~] say__p=1;ParaContent(); print (PrintText) SC_38; .L_Say39; .L_SayX39; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~You~] say__p=1;ParaContent(); print (PrintText) SC_23; .L_Say40; .L_SayX40; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~He~] say__p=1;ParaContent(); print (PrintText) SC_28; .L_Say41; .L_SayX41; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~She~] say__p=1;ParaContent(); print (PrintText) SC_29; .L_Say42; .L_SayX42; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~That~] say__p=1;ParaContent(); print (PrintText) SC_39; .L_Say43; .L_SayX43; ! phrase 13 ! [13: end if] } rfalse; ]; ! From the Standard Rules ! To say contents of ( O - an object ): [ PHR_336 t_0 ! Call parameter 'O' = OBJECT_TY ; ! phrase 1 ! [1: list the contents of o , as a sentence] WriteListFrom(child(t_0), 8); rfalse; ]; ! From "Plurality" by Emily Short ! To say es of ( item - a thing ): [ PHR_765 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: if the item acts plural or the prior named noun is the player begin] if ((( (t_0 has pluralname) )) || ((((Global_Vars-->54) == player)))) { ! phrase 2 ! [2: say ~~] say__p=1;ParaContent(); print (PrintText) EMPTY_TEXT_VALUE; .L_Say44; .L_SayX44; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~es~] say__p=1;ParaContent(); print (PrintText) SC_46; .L_Say45; .L_SayX45; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say has-have of ( item - a thing ): [ PHR_761 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: if the item acts plural or the prior named noun is the player begin] if ((( (t_0 has pluralname) )) || ((((Global_Vars-->54) == player)))) { ! phrase 2 ! [2: say ~have~] say__p=1;ParaContent(); print (PrintText) SC_47; .L_Say46; .L_SayX46; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~has~] say__p=1;ParaContent(); print (PrintText) SC_48; .L_Say47; .L_SayX47; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say ies of ( item - a thing ): [ PHR_767 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: if the item acts plural or the prior named noun is the player begin] if ((( (t_0 has pluralname) )) || ((((Global_Vars-->54) == player)))) { ! phrase 2 ! [2: say ~y~] say__p=1;ParaContent(); print (PrintText) SC_49; .L_Say48; .L_SayX48; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~ies~] say__p=1;ParaContent(); print (PrintText) SC_50; .L_Say49; .L_SayX49; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say is-are of ( item - a thing ): [ PHR_759 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change prior named noun to item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: if prior named noun acts plural or the prior named noun is the player , say ~are~] if ((( ((Global_Vars-->54) has pluralname) )) || ((((Global_Vars-->54) == player)))) { say__p=1;ParaContent(); print (PrintText) SC_51; .L_Say50; .L_SayX50; } ! phrase 3 ! [3: otherwise say ~is~] else { say__p=1;ParaContent(); print (PrintText) SC_52; .L_Say51; .L_SayX51; } rfalse; ]; ! From "Plurality" by Emily Short ! To say it-them of ( item - a thing ): [ PHR_783 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~them~] say__p=1;ParaContent(); print (PrintText) SC_53; .L_Say52; .L_SayX52; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~you~] say__p=1;ParaContent(); print (PrintText) SC_54; .L_Say53; .L_SayX53; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~him~] say__p=1;ParaContent(); print (PrintText) SC_55; .L_Say54; .L_SayX54; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~her~] say__p=1;ParaContent(); print (PrintText) SC_56; .L_Say55; .L_SayX55; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~it~] say__p=1;ParaContent(); print (PrintText) SC_57; .L_Say56; .L_SayX56; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say it-they of ( item - a thing ): [ PHR_775 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~they~] say__p=1;ParaContent(); print (PrintText) SC_58; .L_Say57; .L_SayX57; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~you~] say__p=1;ParaContent(); print (PrintText) SC_54; .L_Say58; .L_SayX58; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~he~] say__p=1;ParaContent(); print (PrintText) SC_59; .L_Say59; .L_SayX59; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~she~] say__p=1;ParaContent(); print (PrintText) SC_60; .L_Say60; .L_SayX60; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~it~] say__p=1;ParaContent(); print (PrintText) SC_57; .L_Say61; .L_SayX61; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say its-their of ( item - a thing ): [ PHR_779 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~their~] say__p=1;ParaContent(); print (PrintText) SC_61; .L_Say62; .L_SayX62; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~your~] say__p=1;ParaContent(); print (PrintText) SC_62; .L_Say63; .L_SayX63; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~his~] say__p=1;ParaContent(); print (PrintText) SC_63; .L_Say64; .L_SayX64; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~her~] say__p=1;ParaContent(); print (PrintText) SC_56; .L_Say65; .L_SayX65; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~its~] say__p=1;ParaContent(); print (PrintText) SC_64; .L_Say66; .L_SayX66; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say its-theirs of ( item - a thing ): [ PHR_787 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~theirs~] say__p=1;ParaContent(); print (PrintText) SC_65; .L_Say67; .L_SayX67; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~yours~] say__p=1;ParaContent(); print (PrintText) SC_66; .L_Say68; .L_SayX68; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~his~] say__p=1;ParaContent(); print (PrintText) SC_63; .L_Say69; .L_SayX69; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~hers~] say__p=1;ParaContent(); print (PrintText) SC_67; .L_Say70; .L_SayX70; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~its~] say__p=1;ParaContent(); print (PrintText) SC_64; .L_Say71; .L_SayX71; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say possessive of ( item - a thing ): [ PHR_791 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item is the player begin] if (((t_0 == player))) { ! phrase 4 ! [4: say ~your~] say__p=1;ParaContent(); print (PrintText) SC_62; .L_Say72; .L_SayX72; ! phrase 5 ! [5: otherwise if the item acts plural] } else if (( (t_0 has pluralname) )) { ! phrase 6 ! [6: say ~[the item][apostrophe]~] say__p=1;ParaContent(); print (the) t_0; ParaContent(); print "'"; .L_Say73; .L_SayX73; ! phrase 7 ! [7: otherwise] } else { ! phrase 8 ! [8: say ~[the item][apostrophe]s~] say__p=1;ParaContent(); print (the) t_0; ParaContent(); print "'"; ParaContent(); print (PrintText) SC_37; .L_Say74; .L_SayX74; ! phrase 9 ! [9: end if] } rfalse; ]; ! To say stats of ( the item - an object ): [ PHR_947 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 2 ! [2: say ~[i]Attack bonus:[r] [weapon attack bonus of the item][lb][i]Damage die:[r] [damage die of the item][lb][i]Dodgability:[r] [dodgability of the item][lb][i]Passive parry max:[r] [passive parry max of the item][lb][i]Active parry max:[r] [active parry max of the item][lb]~] say__p=1;ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_68; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_42; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p22_weapon_attack_bonus)); @pull self; ParaContent(); (PHR_750());ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_69; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_42; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p15_damage_die)); @pull self; ParaContent(); (PHR_750());ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_70; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_42; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p19_dodgability)); @pull self; ParaContent(); (PHR_750());ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_71; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_42; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p20_passive_parry_max)); @pull self; ParaContent(); (PHR_750());ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_72; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_42; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p21_active_parry_max)); @pull self; ParaContent(); (PHR_750()); .L_Say75; .L_SayX75; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~The attack bonus of [the item] is [b][if the weapon attack bonus of the item is less than -1]very bad[else if the weapon attack bonus of the item is -1]bad[else if the weapon attack bonus of the item is 0]normal[else if the weapon attack bonus of the item is 1]good[else if the weapon attack bonus of the item is 2]very good[else if the weapon attack bonus of the item is greater than 2]fantastic[end if][r], ~] say__p=1;ParaContent(); print (PrintText) SC_73; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_74; ParaContent(); (PHR_748()); if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) < -1))))) jump L_Say76; ParaContent(); print (PrintText) SC_75; ParaContent(); jump L_SayX76; .L_Say76; if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) == -1))))) jump L_Say77; ParaContent(); print (PrintText) SC_76; ParaContent(); jump L_SayX76; .L_Say77; if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) == 0))))) jump L_Say78; ParaContent(); print (PrintText) SC_77; ParaContent(); jump L_SayX76; .L_Say78; if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) == 1))))) jump L_Say79; ParaContent(); print (PrintText) SC_78; ParaContent(); jump L_SayX76; .L_Say79; if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) == 2))))) jump L_Say80; ParaContent(); print (PrintText) SC_79; ParaContent(); jump L_SayX76; .L_Say80; if (~~((((ValueProperty(t_0,p22_weapon_attack_bonus) > 2))))) jump L_Say81; ParaContent(); print (PrintText) SC_80; .L_Say81; .L_SayX76; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_81; .L_Say82; .L_SayX77; ! phrase 5 ! [5: say ~and its damage is [b][if the damage die of the item is less than 5]very low[else if the damage die of the item is 5]low[else if the damage die of the item is 6]average[else if the damage die of the item is 7]above average[else if the damage die of the item is 8]high[else if the damage die of the item is 9]very high[else if the damage die of the item is greater than 9]incredible[end if][r]. ~] say__p=1;ParaContent(); print (PrintText) SC_82; ParaContent(); (PHR_748()); if (~~((((ValueProperty(t_0,p15_damage_die) < 5))))) jump L_Say83; ParaContent(); print (PrintText) SC_83; ParaContent(); jump L_SayX78; .L_Say83; if (~~((((ValueProperty(t_0,p15_damage_die) == 5))))) jump L_Say84; ParaContent(); print (PrintText) SC_84; ParaContent(); jump L_SayX78; .L_Say84; if (~~((((ValueProperty(t_0,p15_damage_die) == 6))))) jump L_Say85; ParaContent(); print (PrintText) SC_85; ParaContent(); jump L_SayX78; .L_Say85; if (~~((((ValueProperty(t_0,p15_damage_die) == 7))))) jump L_Say86; ParaContent(); print (PrintText) SC_86; ParaContent(); jump L_SayX78; .L_Say86; if (~~((((ValueProperty(t_0,p15_damage_die) == 8))))) jump L_Say87; ParaContent(); print (PrintText) SC_87; ParaContent(); jump L_SayX78; .L_Say87; if (~~((((ValueProperty(t_0,p15_damage_die) == 9))))) jump L_Say88; ParaContent(); print (PrintText) SC_88; ParaContent(); jump L_SayX78; .L_Say88; if (~~((((ValueProperty(t_0,p15_damage_die) > 9))))) jump L_Say89; ParaContent(); print (PrintText) SC_89; .L_Say89; .L_SayX78; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_90; .L_Say90; .L_SayX79; ! phrase 6 ! [6: say ~It is [b][if the dodgability of the item is less than 0]very hard[else if the dodgability of the item is 0]hard[else if the dodgability of the item is 1]quite hard[else if the dodgability of the item is 2]normally difficult[else if the dodgability of the item is 3]easy[else if the dodgability of the item is greater than 3]very easy[end if][r] to dodge, ~] say__p=1;ParaContent(); print (PrintText) SC_91; ParaContent(); (PHR_748()); if (~~((((ValueProperty(t_0,p19_dodgability) < 0))))) jump L_Say91; ParaContent(); print (PrintText) SC_92; ParaContent(); jump L_SayX80; .L_Say91; if (~~((((ValueProperty(t_0,p19_dodgability) == 0))))) jump L_Say92; ParaContent(); print (PrintText) SC_93; ParaContent(); jump L_SayX80; .L_Say92; if (~~((((ValueProperty(t_0,p19_dodgability) == 1))))) jump L_Say93; ParaContent(); print (PrintText) SC_94; ParaContent(); jump L_SayX80; .L_Say93; if (~~((((ValueProperty(t_0,p19_dodgability) == 2))))) jump L_Say94; ParaContent(); print (PrintText) SC_95; ParaContent(); jump L_SayX80; .L_Say94; if (~~((((ValueProperty(t_0,p19_dodgability) == 3))))) jump L_Say95; ParaContent(); print (PrintText) SC_96; ParaContent(); jump L_SayX80; .L_Say95; if (~~((((ValueProperty(t_0,p19_dodgability) > 3))))) jump L_Say96; ParaContent(); print (PrintText) SC_97; .L_Say96; .L_SayX80; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_98; .L_Say97; .L_SayX81; ! phrase 7 ! [7: say ~and [b][if the passive parry max of the item is less than 0]very hard[else if the passive parry max of the item is 0]hard[else if the passive parry max of the item is 1]quite hard[else if the passive parry max of the item is 2]normally difficult[else if the passive parry max of the item is 3]easy[else if the passive parry max of the item is greater than 3]very easy[end if][r] to parry against. ~] say__p=1;ParaContent(); print (PrintText) SC_99; ParaContent(); (PHR_748()); if (~~((((ValueProperty(t_0,p20_passive_parry_max) < 0))))) jump L_Say98; ParaContent(); print (PrintText) SC_92; ParaContent(); jump L_SayX82; .L_Say98; if (~~((((ValueProperty(t_0,p20_passive_parry_max) == 0))))) jump L_Say99; ParaContent(); print (PrintText) SC_93; ParaContent(); jump L_SayX82; .L_Say99; if (~~((((ValueProperty(t_0,p20_passive_parry_max) == 1))))) jump L_Say100; ParaContent(); print (PrintText) SC_94; ParaContent(); jump L_SayX82; .L_Say100; if (~~((((ValueProperty(t_0,p20_passive_parry_max) == 2))))) jump L_Say101; ParaContent(); print (PrintText) SC_95; ParaContent(); jump L_SayX82; .L_Say101; if (~~((((ValueProperty(t_0,p20_passive_parry_max) == 3))))) jump L_Say102; ParaContent(); print (PrintText) SC_96; ParaContent(); jump L_SayX82; .L_Say102; if (~~((((ValueProperty(t_0,p20_passive_parry_max) > 3))))) jump L_Say103; ParaContent(); print (PrintText) SC_97; .L_Say103; .L_SayX82; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_100; .L_Say104; .L_SayX83; ! phrase 8 ! [8: say ~In addition, it is a[b][if the active parry max of the item is less than 1] very bad[else if the active parry max of the item is 1] bad[else if the active parry max of the item is 2][r]n[b] average[else if the active parry max of the item is 3] good[else if the active parry max of the item is greater than 3][r]n[b] excellent[end if][r] weapon to parry with. ~] say__p=1;ParaContent(); print (PrintText) SC_101; ParaContent(); (PHR_748()); if (~~((((ValueProperty(t_0,p21_active_parry_max) < 1))))) jump L_Say105; ParaContent(); print (PrintText) SC_102; ParaContent(); jump L_SayX84; .L_Say105; if (~~((((ValueProperty(t_0,p21_active_parry_max) == 1))))) jump L_Say106; ParaContent(); print (PrintText) SC_103; ParaContent(); jump L_SayX84; .L_Say106; if (~~((((ValueProperty(t_0,p21_active_parry_max) == 2))))) jump L_Say107; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_104; ParaContent(); (PHR_748());ParaContent(); print (PrintText) SC_105; ParaContent(); jump L_SayX84; .L_Say107; if (~~((((ValueProperty(t_0,p21_active_parry_max) == 3))))) jump L_Say108; ParaContent(); print (PrintText) SC_106; ParaContent(); jump L_SayX84; .L_Say108; if (~~((((ValueProperty(t_0,p21_active_parry_max) > 3))))) jump L_Say109; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_104; ParaContent(); (PHR_748());ParaContent(); print (PrintText) SC_107; .L_Say109; .L_SayX84; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_108; .L_Say110; .L_SayX85; ! phrase 9 ! [9: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say that-those of ( item - a thing ): [ PHR_770 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~those~] say__p=1;ParaContent(); print (PrintText) SC_109; .L_Say111; .L_SayX86; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~you~] say__p=1;ParaContent(); print (PrintText) SC_54; .L_Say112; .L_SayX87; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~he~] say__p=1;ParaContent(); print (PrintText) SC_59; .L_Say113; .L_SayX88; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~she~] say__p=1;ParaContent(); print (PrintText) SC_60; .L_Say114; .L_SayX89; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~that~] say__p=1;ParaContent(); print (PrintText) SC_110; .L_Say115; .L_SayX90; ! phrase 13 ! [13: end if] } rfalse; ]; ! To have a reaction: [ PHR_835 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat with n running from 1 to the number of rows in the table of combat order begin] for (t_0=1: t_0<= TableRows(T4_combat_order) : t_0++) { if (debug_rules>1) print " [repetition with N set to ", (DecimalNumber) t_0, "]^"; ! phrase 2 ! [2: choose row n in the table of combat order] ct_0 = T4_combat_order; ct_1 = t_0; ! phrase 3 ! [3: if there is combatant in row n of the table of combat order begin] if (( (ExistsTableLookUpEntry(T4_combat_order,111,t_0)) )) { ! phrase 4 ! [4: if the combat state of the combatant entry is react begin] if (((ValueProperty(TableLookUpEntry(ct_0,111,ct_1),p76_combat_state) == Q77_react))) { ! phrase 5 ! [5: now the global attacker is the combatant entry] (Global_Vars-->63) = TableLookUpEntry(ct_0,111,ct_1); ! phrase 6 ! [6: if the global attacker is the player begin] if ((((Global_Vars-->63) == player))) { ! phrase 7 ! [7: stop] return; ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: if the global attacker is alive , consider the combat ai rulebook of the global attacker] if (((Adj_20_t1_v64((Global_Vars-->63))))) { ProcessRulebook(ValueProperty((Global_Vars-->63),p18_combat_ai_rulebook)); } ! phrase 10 ! [10: now the combat state of the global attacker is acted] WriteValueProperty((Global_Vars-->63),p76_combat_state,Q76_acted); ! phrase 11 ! [11: end if] } ! phrase 12 ! [12: end if] } ! phrase 13 ! [13: end repeat] } if (debug_rules>1) print " [13: end repeat]^"; rfalse; ]; ! From "Dice-lock" by S John Ross ! To lock the dice: [ PHR_800 ; ! phrase 1 ! [1: seed the random-number generator with dicelock] VM_Seed_RNG((Global_Vars-->55)); ! phrase 2 ! [2: sprout the seed] (PHR_803()); ! phrase 3 ! [3: if dicelock is greater than 30000 begin] if ((((Global_Vars-->55) > 30000))) { ! phrase 4 ! [4: change dicelock to dicelock divided by 29] (Global_Vars-->55) = (IntegerDivide((Global_Vars-->55),29)) ; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Basic Screen Effects" by Emily Short ! To pause the/-- game: [ PHR_727 ; ! phrase 1 ! [1: say ~[paragraph break]Please press SPACE to continue.~] say__p=1;ParaContent(); DivideParagraphPoint(); new_line; ParaContent(); print (PrintText) SC_111; new_line; .L_Say116; .L_SayX91; ! phrase 2 ! [2: wait for the space key] SPACEPause(); ! phrase 3 ! [3: clear the screen] VM_ClearScreen(0); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To reset the links: [ PHR_713 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of current choices begin] @push ct_0; @push ct_1; for (t_0=T2_current_choices,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 2 ! [2: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 3 ! [3: end repeat] } @pull ct_1; @pull ct_0; ! phrase 4 ! [4: change rowcount to 0] (Global_Vars-->48) = 0; rfalse; ]; ! To run the combat: [ PHR_837 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_0(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_0 I7BASPL t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: now the fight consequences variable is true] (Global_Vars-->62) = 1; ! phrase 2 ! [2: sort the table of stored combat actions in combat speed order] TableSort(T5_stored_combat_actions, 113, 1); ! phrase 3 ! [3: repeat through the table of stored combat actions begin] @push ct_0; @push ct_1; for (t_0=T5_stored_combat_actions,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 4 ! [4: try the combat action entry] STORED_ACTION_TY_Try(BlkValueCopy((blockv_stack-->(I7BASPL+0)), TableLookUpEntry(ct_0,114,ct_1))); ! phrase 5 ! [5: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 6 ! [6: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [6: end repeat]^"; ! phrase 7 ! [7: now the fight consequences variable is false] (Global_Vars-->62) = 0; rfalse; ]; ! To say CAP-second noun: [ PHR_816 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_1(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_1 I7BASPL ; ! phrase 1 ! [1: if the second noun is the player begin] if (((second == player))) { ! phrase 2 ! [2: say ~[The second noun]~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_2)), 3) ; .L_Say117; .L_SayX92; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[The second noun]~] say__p=1;ParaContent(); print (The) second; .L_Say118; .L_SayX93; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap it-them: [ PHR_784 ; ! phrase 1 ! [1: say cap it-them of prior named noun] say__p=1;ParaContent(); (PHR_785((Global_Vars-->54))); .L_Say119; .L_SayX94; rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap it-they: [ PHR_776 ; ! phrase 1 ! [1: say cap it-they of prior named noun] say__p=1;ParaContent(); (PHR_777((Global_Vars-->54))); .L_Say120; .L_SayX95; rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap its-their: [ PHR_780 ; ! phrase 1 ! [1: say cap its-their of prior named noun] say__p=1;ParaContent(); (PHR_781((Global_Vars-->54))); .L_Say121; .L_SayX96; rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap its-theirs: [ PHR_788 ; ! phrase 1 ! [1: say its-theirs of prior named noun] say__p=1;ParaContent(); (PHR_787((Global_Vars-->54))); .L_Say122; .L_SayX97; rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap possessive: [ PHR_792 ; ! phrase 1 ! [1: say cap possessive of prior named noun] say__p=1;ParaContent(); (PHR_793((Global_Vars-->54))); .L_Say123; .L_SayX98; rfalse; ]; ! From "Plurality" by Emily Short ! To say Cap that-those: [ PHR_769 ; ! phrase 1 ! [1: say cap that-those prior named noun] say__p=1;ParaContent(); (PHR_771((Global_Vars-->54))); .L_Say124; .L_SayX99; rfalse; ]; ! To say capital health: [ PHR_809 ; ! phrase 1 ! [1: say ~Health~] say__p=1;ParaContent(); print (PrintText) SC_112; .L_Say125; .L_SayX100; rfalse; ]; ! From "Dice-lock" by S John Ross ! To sprout the seed: [ PHR_803 ; ! phrase 1 ! [1: increase dicelock by a random number between 0 and 9] (Global_Vars-->55) = (Global_Vars-->55) + (GenerateRandomNumber(0, 9)) ; ! phrase 2 ! [2: increase dicelock by a random number between 0 and 9] (Global_Vars-->55) = (Global_Vars-->55) + (GenerateRandomNumber(0, 9)) ; ! phrase 3 ! [3: increase dicelock by a random number between 1 and 9] (Global_Vars-->55) = (Global_Vars-->55) + (GenerateRandomNumber(1, 9)) ; rfalse; ]; ! To decide whether there are reactionaries: [ PHR_834 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; ! phrase 1 ! [1: repeat with x running through alive persons enclosed by the location begin] for (t_0=Prop_7(0), t_1=Prop_7(t_0): t_0: t_0=t_1, t_1=Prop_7(t_1)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_0, "]^"; ! phrase 2 ! [2: if the combat state of x is react , decide yes] if (((ValueProperty(t_0,p76_combat_state) == Q77_react))) { rtrue; } ! phrase 3 ! [3: end repeat] } if (debug_rules>1) print " [3: end repeat]^"; ! phrase 4 ! [4: decide no] rfalse; rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To link to ( response - a chat node ): [ PHR_712 t_0 ! Call parameter 'response' = ; ! phrase 1 ! [1: if response is active begin] if (((PHR_711(t_0)))) { ! phrase 2 ! [2: increase rowcount by 1] (Global_Vars-->48) = (Global_Vars-->48) + 1; ! phrase 3 ! [3: if rowcount <= the number of rows in table of current choices begin] if ((((Global_Vars-->48) <= TableRows(T2_current_choices) ))) { ! phrase 4 ! [4: change result in row rowcount of table of current choices to response] TableLookUpEntry(T2_current_choices,107,(Global_Vars-->48),1,t_0); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: decrease rowcount by 1] (Global_Vars-->48) = (Global_Vars-->48) - 1; ! phrase 7 ! [7: end if] } ! phrase 8 ! [8: end if] } rfalse; ]; ! From "Plurality" by Emily Short ! To say that-those ( item - a thing ): [ PHR_772 t_0 ! Call parameter 'item' = OBJECT_TY ; ! phrase 1 ! [1: change the prior named noun to the item] (Global_Vars-->54) = t_0; ! phrase 2 ! [2: mark prior named noun in output] (PHR_754((Global_Vars-->54))); ! phrase 3 ! [3: if the item acts plural begin] if (( (t_0 has pluralname) )) { ! phrase 4 ! [4: say ~those~] say__p=1;ParaContent(); print (PrintText) SC_109; .L_Say126; .L_SayX101; ! phrase 5 ! [5: otherwise if the item is the player] } else if (((t_0 == player))) { ! phrase 6 ! [6: say ~you~] say__p=1;ParaContent(); print (PrintText) SC_54; .L_Say127; .L_SayX102; ! phrase 7 ! [7: otherwise if the item is male and item is not neuter] } else if ((((Adj_61_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 8 ! [8: say ~he~] say__p=1;ParaContent(); print (PrintText) SC_59; .L_Say128; .L_SayX103; ! phrase 9 ! [9: otherwise if the item is female and item is not neuter] } else if ((((Adj_60_t1_v64(t_0)))) && ((~~((Adj_62_t1_v64(t_0)))))) { ! phrase 10 ! [10: say ~she~] say__p=1;ParaContent(); print (PrintText) SC_60; .L_Say129; .L_SayX104; ! phrase 11 ! [11: otherwise] } else { ! phrase 12 ! [12: say ~that~] say__p=1;ParaContent(); print (PrintText) SC_110; .L_Say130; .L_SayX105; ! phrase 13 ! [13: end if] } rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To decide whether ( which - a chat node ) is active: [ PHR_711 t_0 ! Call parameter 'which' = ; ! phrase 1 ! [1: if which activates quip on , decide yes] if ((((Relation_TestVtoV(t_0,V2V_Bitmap_65,Q55_quip_on,false))))) { rtrue; } ! phrase 2 ! [2: decide no] rfalse; rfalse; ]; ! To say CAP-actor: [ PHR_814 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_2(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_2 I7BASPL ; ! phrase 1 ! [1: if the global actor is the player begin] if ((((Global_Vars-->57) == player))) { ! phrase 2 ! [2: say ~[The global actor]~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_3)), 3) ; .L_Say131; .L_SayX106; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[The global actor]~] say__p=1;ParaContent(); print (The) (Global_Vars-->57); .L_Say132; .L_SayX107; ! phrase 5 ! [5: end if] } rfalse; ]; ! To say CAP-attacker: [ PHR_812 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_3(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_3 I7BASPL ; ! phrase 1 ! [1: if the global attacker is the player begin] if ((((Global_Vars-->63) == player))) { ! phrase 2 ! [2: say ~[The global attacker]~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_4)), 3) ; .L_Say133; .L_SayX108; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[The global attacker]~] say__p=1;ParaContent(); print (The) (Global_Vars-->63); .L_Say134; .L_SayX109; ! phrase 5 ! [5: end if] } rfalse; ]; ! To say CAP-defender: [ PHR_813 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_4(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_4 I7BASPL ; ! phrase 1 ! [1: if the global defender is the player begin] if ((((Global_Vars-->64) == player))) { ! phrase 2 ! [2: say ~[The global defender]~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_5)), 3) ; .L_Say135; .L_SayX110; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[The global defender]~] say__p=1;ParaContent(); print (The) (Global_Vars-->64); .L_Say136; .L_SayX111; ! phrase 5 ! [5: end if] } rfalse; ]; ! To say CAP-noun: [ PHR_815 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_5(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_5 I7BASPL ; ! phrase 1 ! [1: if the noun is the player begin] if (((noun == player))) { ! phrase 2 ! [2: say ~[The noun]~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_6)), 3) ; .L_Say137; .L_SayX112; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[The noun]~] say__p=1;ParaContent(); print (The) noun; .L_Say138; .L_SayX113; ! phrase 5 ! [5: end if] } rfalse; ]; ! From "Dice-lock" by S John Ross ! To say RandomLock: [ PHR_802 ; ! phrase 1 ! [1: lock the dice] (PHR_800()); rfalse; ]; ! To say b: [ PHR_748 ; ! phrase 1 ! [1: say ~[bold type]~] say__p=1;ParaContent(); style bold; .L_Say139; .L_SayX114; rfalse; ]; ! From "Plurality" by Emily Short ! To say es: [ PHR_764 ; ! phrase 1 ! [1: say es of prior named noun] say__p=1;ParaContent(); (PHR_765((Global_Vars-->54))); .L_Say140; .L_SayX115; rfalse; ]; ! From "Plurality" by Emily Short ! To say has-have: [ PHR_760 ; ! phrase 1 ! [1: say has-have of prior named noun] say__p=1;ParaContent(); (PHR_761((Global_Vars-->54))); .L_Say141; .L_SayX116; rfalse; ]; ! To say health: [ PHR_810 ; ! phrase 1 ! [1: say ~health~] say__p=1;ParaContent(); print (PrintText) SC_113; .L_Say142; .L_SayX117; rfalse; ]; ! To say i: [ PHR_746 ; ! phrase 1 ! [1: say ~[italic type]~] say__p=1;ParaContent(); style underline; .L_Say143; .L_SayX118; rfalse; ]; ! From "Plurality" by Emily Short ! To say ies: [ PHR_766 ; ! phrase 1 ! [1: say ies of prior named noun] say__p=1;ParaContent(); (PHR_767((Global_Vars-->54))); .L_Say144; .L_SayX119; rfalse; ]; ! From "Plurality" by Emily Short ! To say is-are: [ PHR_758 ; ! phrase 1 ! [1: say is-are of prior named noun] say__p=1;ParaContent(); (PHR_759((Global_Vars-->54))); .L_Say145; .L_SayX120; rfalse; ]; ! From "Plurality" by Emily Short ! To say it-them: [ PHR_782 ; ! phrase 1 ! [1: say it-them of prior named noun] say__p=1;ParaContent(); (PHR_783((Global_Vars-->54))); .L_Say146; .L_SayX121; rfalse; ]; ! From "Plurality" by Emily Short ! To say it-they: [ PHR_774 ; ! phrase 1 ! [1: say it-they of prior named noun] say__p=1;ParaContent(); (PHR_775((Global_Vars-->54))); .L_Say147; .L_SayX122; rfalse; ]; ! From "Plurality" by Emily Short ! To say its-their: [ PHR_778 ; ! phrase 1 ! [1: say its-their of prior named noun] say__p=1;ParaContent(); (PHR_779((Global_Vars-->54))); .L_Say148; .L_SayX123; rfalse; ]; ! From "Plurality" by Emily Short ! To say its-theirs: [ PHR_786 ; ! phrase 1 ! [1: say its-theirs of prior named noun] say__p=1;ParaContent(); (PHR_787((Global_Vars-->54))); .L_Say149; .L_SayX124; rfalse; ]; ! To say lb: [ PHR_750 ; ! phrase 1 ! [1: say ~[line break]~] say__p=1;ParaContent(); new_line; .L_Say150; .L_SayX125; rfalse; ]; ! To say lbr: [ PHR_751 ; ! phrase 1 ! [1: say ~[bracket]~] say__p=1;ParaContent(); print "["; .L_Say151; .L_SayX126; rfalse; ]; ! To say pb: [ PHR_749 ; ! phrase 1 ! [1: say ~[paragraph break]~] say__p=1;ParaContent(); DivideParagraphPoint(); new_line; .L_Say152; .L_SayX127; rfalse; ]; ! From "Plurality" by Emily Short ! To say possessive: [ PHR_790 ; ! phrase 1 ! [1: say possessive of prior named noun] say__p=1;ParaContent(); (PHR_791((Global_Vars-->54))); .L_Say153; .L_SayX128; rfalse; ]; ! To say r: [ PHR_747 ; ! phrase 1 ! [1: say ~[roman type]~] say__p=1;ParaContent(); style roman; .L_Say154; .L_SayX129; rfalse; ]; ! To say rbr: [ PHR_752 ; ! phrase 1 ! [1: say ~[close bracket]~] say__p=1;ParaContent(); print "]"; .L_Say155; .L_SayX130; rfalse; ]; ! To say rpo: [ PHR_745 ; ! phrase 1 ! [1: say ~[run paragraph on]~] say__p=1;ParaContent(); RunParagraphOn(); .L_Say156; .L_SayX131; rfalse; ]; ! From "Plurality" by Emily Short ! To say that-those: [ PHR_768 ; ! phrase 1 ! [1: say that-those prior named noun] say__p=1;ParaContent(); (PHR_772((Global_Vars-->54))); .L_Say157; .L_SayX132; rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To activate ( which - a chat node ): [ PHR_709 t_0 ! Call parameter 'which' = ; ! phrase 1 ! [1: now which activates quip on] (Relation_NowVtoV(t_0,V2V_Bitmap_65,Q55_quip_on,false)); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! To deactivate ( which - a chat node ): [ PHR_710 t_0 ! Call parameter 'which' = ; ! phrase 1 ! [1: now which does not activate quip on] (Relation_NowNVtoV(t_0,V2V_Bitmap_65,Q55_quip_on,false)); rfalse; ]; ! Definitions of rule phrases ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Startup (B1_startup) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/10: VIRTUAL_MACHINE_STARTUP_R ! === which is equally specific with === ! Rule 2/10: INITIALISE_MEMORY_R ! === which is equally specific with === ! Rule 3/10: SEED_RANDOM_NUMBER_GENERATOR_R ! === which is equally specific with === ! Rule 4/10: UPDATE_CHRONOLOGICAL_RECORDS_R ! === which is equally specific with === ! Rule 5/10: POSITION_PLAYER_IN_MODEL_R ! === which is equally specific with === ! Rule 6/10 ! This is the start in the correct scenes rule: ! --- now the mid-placed rules --- ! Rule 7/10 ! This is the when play begins stage rule: ! === which is equally specific with === ! Rule 8/10 ! This is the fix baseline scoring rule: ! === which is equally specific with === ! Rule 9/10 ! This is the display banner rule: ! === which is equally specific with === ! Rule 10/10 ! This is the initial room description rule: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the start in the correct scenes rule: [ R_5 ; ! phrase 1 ! [1: consider the scene changing rules] ProcessRulebook(4); rfalse; ]; ! From the Standard Rules ! This is the when play begins stage rule: [ R_6 ; ! phrase 1 ! [1: follow the when play begins rulebook] FollowRulebook(5); rfalse; ]; ! From the Standard Rules ! This is the fix baseline scoring rule: [ R_7 ; ! phrase 1 ! [1: now the last notified score is the score] last_score = score; rfalse; ]; ! From the Standard Rules ! This is the display banner rule: [ R_8 ; ! phrase 1 ! [1: say ~[banner text]~] say__p=1;ParaContent(); Banner(); .L_Say158; .L_SayX133; rfalse; ]; ! From the Standard Rules ! This is the initial room description rule: [ R_9 ; ! phrase 1 ! [1: try looking] TryAction(0, player, ##Look, 0, 0);; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Turn sequence (B2_turn_sequence) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/14: PARSE_COMMAND_R ! === which is equally specific with === ! Rule 2/14: GENERATE_ACTION_R ! === which is equally specific with === ! Rule 3/14 ! First turn sequence rule: ! === which is equally specific with === ! Rule 4/14 ! A first turn sequence rule: ! === which is equally specific with === ! Rule 5/14 ! First turn sequence rule ( this is the begin the combat round rule ): ! === which is equally specific with === ! Rule 6/14 ! A first turn sequence rule ( this is the every turn stage rule ): ! --- now the mid-placed rules --- ! Rule 7/14: TIMED_EVENTS_R ! === which is equally specific with === ! Rule 8/14: ADVANCE_TIME_R ! === which is equally specific with === ! Rule 9/14: UPDATE_CHRONOLOGICAL_RECORDS_R ! --- now the last-placed rules --- ! Rule 10/14 ! A last turn sequence rule: ! === which is equally specific with === ! Rule 11/14 ! Last turn sequence rule: ! === which is equally specific with === ! Rule 12/14: ADJUST_LIGHT_R ! === which is equally specific with === ! Rule 13/14: NOTE_OBJECT_ACQUISITIONS_R ! === which is equally specific with === ! Rule 14/14 ! This is the notify score changes rule: ! ---------------------------------------------------------------------------------------------------- ! First turn sequence rule: [ R_817 ; ! phrase 1 ! [1: if acting fast , rule succeeds] if ((NAP_1()) && (actor==player)) { RulebookSucceeds(); rtrue; } rfalse; ]; ! From the Standard Rules ! A first turn sequence rule: [ R_11 ; ! phrase 1 ! [1: consider the scene changing rules] ProcessRulebook(4); rfalse; ]; ! First turn sequence rule ( this is the begin the combat round rule ): [ R_831 ; ! phrase 1 ! [1: set up the combat order] (PHR_832()); rfalse; ]; ! From the Standard Rules ! A first turn sequence rule ( this is the every turn stage rule ): [ R_10 ; ! phrase 1 ! [1: follow the every turn rules] FollowRulebook(7); rfalse; ]; ! From the Standard Rules ! A last turn sequence rule: [ R_12 ; ! phrase 1 ! [1: consider the scene changing rules] ProcessRulebook(4); rfalse; ]; ! Last turn sequence rule: [ R_833 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat with m running from 1 to the number of rows in the table of combat order begin] for (t_0=1: t_0<= TableRows(T4_combat_order) : t_0++) { if (debug_rules>1) print " [repetition with M set to ", (DecimalNumber) t_0, "]^"; ! phrase 2 ! [2: if there is a combatant in row m of the table of combat order begin] if (( (ExistsTableLookUpEntry(T4_combat_order,111,t_0)) )) { ! phrase 3 ! [3: choose row m in the table of combat order] ct_0 = T4_combat_order; ct_1 = t_0; ! phrase 4 ! [4: if the combatant entry is the player , stop] if (((TableLookUpEntry(ct_0,111,ct_1) == player))) { return; } ! phrase 5 ! [5: unless the combat state of the combatant entry is acted begin] if (~~(((ValueProperty(TableLookUpEntry(ct_0,111,ct_1),p76_combat_state) == Q76_acted)))) { ! phrase 6 ! [6: now the global attacker is the combatant entry] (Global_Vars-->63) = TableLookUpEntry(ct_0,111,ct_1); ! phrase 7 ! [7: if the global attacker is alive , consider the combat ai rulebook of the global attacker] if (((Adj_20_t1_v64((Global_Vars-->63))))) { ProcessRulebook(ValueProperty((Global_Vars-->63),p18_combat_ai_rulebook)); } ! phrase 8 ! [8: now the combat state of the combatant entry is acted] WriteValueProperty(TableLookUpEntry(ct_0,111,ct_1),p76_combat_state,Q76_acted); ! phrase 9 ! [9: if the combat state of the player is react , stop] if (((ValueProperty(player,p76_combat_state) == Q77_react))) { return; } ! phrase 10 ! [10: while there are reactionaries , have a reaction] while (((PHR_834()))) { (PHR_835()); } ! phrase 11 ! [11: run the combat] (PHR_837()); ! phrase 12 ! [12: end unless] } ! phrase 13 ! [13: end if] } ! phrase 14 ! [14: end repeat] } if (debug_rules>1) print " [14: end repeat]^"; rfalse; ]; ! From the Standard Rules ! This is the notify score changes rule: [ R_13 ; ! phrase 1 ! [1: if the score is not the last notified score begin] if ((~~((score == last_score)))) { ! phrase 2 ! [2: issue score notification message] NotifyTheScore(); ! phrase 3 ! [3: now the last notified score is the score] last_score = score; ! phrase 4 ! [4: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Shutdown (B3_shutdown) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! This is the when play ends stage rule: ! --- now the last-placed rules --- ! Rule 2/4: RESURRECT_PLAYER_IF_ASKED_R ! === which is equally specific with === ! Rule 3/4 ! This is the print player's obituary rule: ! === which is equally specific with === ! Rule 4/4: ASK_FINAL_QUESTION_R ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the when play ends stage rule: [ R_14 ; ! phrase 1 ! [1: follow the when play ends rulebook] FollowRulebook(6); rfalse; ]; ! From the Standard Rules ! This is the print player's obituary rule: [ R_15 ; ! phrase 1 ! [1: carry out the printing the player's obituary activity] CarryOutActivity(V27_printing_the_player_s_ob); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: When play begins (B5_when_play_begins) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/8 ! When play begins ( this is the first combat round rule ): ! === which is equally specific with === ! Rule 2/8 ! When play begins: ! === which is equally specific with === ! Rule 3/8 ! When play begins: ! === which is equally specific with === ! Rule 4/8 ! When play begins: ! === which is equally specific with === ! Rule 5/8 ! When play begins: ! === which is equally specific with === ! Rule 6/8 ! When play begins: ! === which is equally specific with === ! Rule 7/8 ! When play begins: ! === which is equally specific with === ! Rule 8/8 ! First every turn rule ( this is the ready natural weapons if no other weapon readied rule ): ! ---------------------------------------------------------------------------------------------------- ! When play begins ( this is the first combat round rule ): [ R_830 ; ! phrase 1 ! [1: set up the combat order] (PHR_832()); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! When play begins: [ R_720 t_0 ! Local variable e.g. 'current node' = ; ! phrase 1 ! [1: let current node be the chat node after no quip chosen] t_0 = A_T47_chat_node(Q53_no_quip_chosen) ; ! phrase 2 ! [2: while current node is not no quip chosen begin] while ((~~((t_0 == Q53_no_quip_chosen)))) { ! phrase 3 ! [3: change first chat node to current node] (Global_Vars-->49) = t_0; ! phrase 4 ! [4: try preparing current node] TryAction(0, player, ##A83_preparing, t_0, 0);; ! phrase 5 ! [5: change current node to the chat node after current node] t_0 = A_T47_chat_node(t_0) ; ! phrase 6 ! [6: end while] } rfalse; ]; ! When play begins: [ R_740 ; ! phrase 1 ! [1: say ~Orestes, wake up! Wake up, son of Agamemnon! And be of good cheer, for the day of your dreams has finally come.~] say__p=1;ParaContent(); print (PrintText) SC_114; new_line; .L_Say159; .L_SayX134; ! phrase 2 ! [2: now the numbers boolean is false] (Global_Vars-->56) = 0; rfalse; ]; ! From "Dice-lock" by S John Ross ! When play begins: [ R_799 ; ! phrase 1 ! [1: change dicelock to a random number between 1000 and 9999] (Global_Vars-->55) = (GenerateRandomNumber(1000, 9999)) ; rfalse; ]; ! When play begins: [ R_805 ; ! phrase 1 ! [1: seed the random-number generator with 81] VM_Seed_RNG(81); rfalse; ]; ! When play begins: [ R_821 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; ! phrase 1 ! [1: repeat with the patient running through people begin] for (t_0=Prop_8(0), t_1=Prop_8(t_0): t_0: t_0=t_1, t_1=Prop_8(t_1)) { if (debug_rules>1) print " [repetition with patient set to ", (PrintShortName) t_0, "]^"; ! phrase 2 ! [2: change the permanent health of the patient to the health of the patient] WriteValueProperty(t_0,p11_permanent_health,ValueProperty(t_0,p10_health)); ! phrase 3 ! [3: end repeat] } if (debug_rules>1) print " [3: end repeat]^"; rfalse; ]; ! When play begins: [ R_824 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; ! phrase 1 ! [1: repeat with the patient running through people begin] for (t_0=Prop_9(0), t_1=Prop_9(t_0): t_0: t_0=t_1, t_1=Prop_9(t_1)) { if (debug_rules>1) print " [repetition with patient set to ", (PrintShortName) t_0, "]^"; ! phrase 2 ! [2: change the gained health of the patient to a random number between 1 and the permanent health of the patient] WriteValueProperty(t_0,p12_gained_health, (GenerateRandomNumber(1, ValueProperty(t_0,p11_permanent_health))) ); ! phrase 3 ! [3: end repeat] } if (debug_rules>1) print " [3: end repeat]^"; rfalse; ]; ! First every turn rule ( this is the ready natural weapons if no other weapon readied rule ): [ R_930 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_2 ! Local variable e.g. 'item' = OBJECT_TY ; ! phrase 1 ! [1: repeat with x running through all alive persons enclosed by the location begin] for (t_0=Prop_10(0), t_1=Prop_10(t_0): t_0: t_0=t_1, t_1=Prop_10(t_1)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_0, "]^"; ! phrase 2 ! [2: if x encloses no readied weapon begin] if ((Prop_11(,t_0))) { ! phrase 3 ! [3: let item be a random natural weapon part of x] t_2 = (Prop_12(,t_0)) ; ! phrase 4 ! [4: now item is readied] Adj_81_t2_v64(t_2); ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: end repeat] } if (debug_rules>1) print " [6: end repeat]^"; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Every turn (B7_every_turn) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! First every turn rule ( this is the ready natural weapons if no other weapon readied rule ): ! --- now the mid-placed rules --- ! Rule 2/3 ! Every turn: ! === which is equally specific with === ! Rule 3/3 ! Every turn: ! ---------------------------------------------------------------------------------------------------- ! From "Plurality" by Emily Short ! Every turn: [ R_794 ; ! phrase 1 ! [1: if the noun is a thing and the noun is ambiguously plural , notice the plurality of the noun] if ((((noun ofclass K2_thing))) && (((Adj_67_t1_v64(noun))))) { PlugPlural(noun); } ! phrase 2 ! [2: if the second noun is a thing and the second noun is ambiguously plural , notice the plurality of the second noun] if ((((second ofclass K2_thing))) && (((Adj_67_t1_v64(second))))) { PlugPlural(second); } rfalse; ]; ! Every turn: [ R_836 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: now the combat state of the player is acted] WriteValueProperty(player,p76_combat_state,Q76_acted); ! phrase 2 ! [2: now the global attacker is the player] (Global_Vars-->63) = player; ! phrase 3 ! [3: while there are reactionaries , have a reaction] while (((PHR_834()))) { (PHR_835()); } ! phrase 4 ! [4: run the combat] (PHR_837()); ! phrase 5 ! [5: repeat with m running from 1 to the number of rows in the table of combat order begin] for (t_0=1: t_0<= TableRows(T4_combat_order) : t_0++) { if (debug_rules>1) print " [repetition with M set to ", (DecimalNumber) t_0, "]^"; ! phrase 6 ! [6: if there is a combatant in row m of the table of combat order begin] if (( (ExistsTableLookUpEntry(T4_combat_order,111,t_0)) )) { ! phrase 7 ! [7: choose row m in the table of combat order] ct_0 = T4_combat_order; ct_1 = t_0; ! phrase 8 ! [8: unless the combat state of the combatant entry is acted begin] if (~~(((ValueProperty(TableLookUpEntry(ct_0,111,ct_1),p76_combat_state) == Q76_acted)))) { ! phrase 9 ! [9: now the global attacker is the combatant entry] (Global_Vars-->63) = TableLookUpEntry(ct_0,111,ct_1); ! phrase 10 ! [10: if the global attacker is alive , consider the combat ai rulebook of the global attacker] if (((Adj_20_t1_v64((Global_Vars-->63))))) { ProcessRulebook(ValueProperty((Global_Vars-->63),p18_combat_ai_rulebook)); } ! phrase 11 ! [11: now the combat state of the combatant entry is acted] WriteValueProperty(TableLookUpEntry(ct_0,111,ct_1),p76_combat_state,Q76_acted); ! phrase 12 ! [12: while there are reactionaries , have a reaction] while (((PHR_834()))) { (PHR_835()); } ! phrase 13 ! [13: run the combat] (PHR_837()); ! phrase 14 ! [14: end unless] } ! phrase 15 ! [15: end if] } ! phrase 16 ! [16: end repeat] } if (debug_rules>1) print " [16: end repeat]^"; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Action-processing (B8_action_processing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/11 ! This is the announce items from multiple object lists rule: ! === which is equally specific with === ! Rule 2/11 ! This is the set pronouns from items from multiple object lists rule: ! === which is equally specific with === ! Rule 3/11 ! This is the before stage rule: ! --- now the mid-placed rules --- ! Rule 4/11: BASIC_VISIBILITY_R ! === which is equally specific with === ! Rule 5/11: BASIC_ACCESSIBILITY_R ! === which is equally specific with === ! Rule 6/11: CARRYING_REQUIREMENTS_R ! --- now the last-placed rules --- ! Rule 7/11 ! This is the instead stage rule: ! === which is equally specific with === ! Rule 8/11: REQUESTED_ACTIONS_REQUIRE_R ! === which is equally specific with === ! Rule 9/11: CARRY_OUT_REQUESTED_ACTIONS_R ! === which is equally specific with === ! Rule 10/11: DESCEND_TO_SPECIFIC_ACTION_R ! === which is equally specific with === ! Rule 11/11 ! This is the end action-processing in success rule: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the announce items from multiple object lists rule: [ R_17 ; ! phrase 1 ! [1: if the current item from the multiple object list is not nothing , say ~[current item from the multiple object list]: [run paragraph on]~] if ((~~((multiple_object_item == nothing)))) { say__p=1;ParaContent(); print (name) multiple_object_item; ParaContent(); print (PrintText) SC_115; ParaContent(); RunParagraphOn(); .L_Say160; .L_SayX135; } rfalse; ]; ! From the Standard Rules ! This is the set pronouns from items from multiple object lists rule: [ R_16 ; ! phrase 1 ! [1: if the current item from the multiple object list is not nothing , set pronouns from the current item from the multiple object list] if ((~~((multiple_object_item == nothing)))) { PronounNotice(multiple_object_item); } rfalse; ]; ! From the Standard Rules ! This is the before stage rule: [ R_18 ; ! phrase 1 ! [1: abide by the before rules] if (ProcessRulebook(18)) rtrue; rfalse; ]; ! From the Standard Rules ! This is the instead stage rule: [ R_19 ; ! phrase 1 ! [1: abide by the instead rules] if (ProcessRulebook(19)) rtrue; rfalse; ]; ! From the Standard Rules ! This is the end action-processing in success rule: [ R_20 ; ! phrase 1 ! [1: rule succeeds] RulebookSucceeds(); rtrue; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Setting action variables (B9_setting_action_variables) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Rule for setting action variables for going ( this is the standard set going variables rule ): ! === which is equally specific with === ! Rule 2/3 ! Setting action variables for looking ( this is the determine visibility ceiling rule ): ! === which is equally specific with === ! Rule 3/3 ! Setting action variables for exiting: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Rule for setting action variables for going ( this is the standard set going variables rule ): [ R_123 t_0 ! Local variable e.g. 'carriage' = OBJECT_TY t_1 ! Local variable e.g. 'target' = OBJECT_TY t_2 ! Local variable e.g. 'direction D' = OBJECT_TY ; if ((action ==##Go)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_123, 123); ! phrase 1 ! [1: now the thing gone with is the item-pushed-between-rooms] (MStack-->MstVO(20007,4)) = move_pushing; ! phrase 2 ! [2: now the room gone from is the location of the actor] (MStack-->MstVO(20007,0)) = LocationOf(actor) ; ! phrase 3 ! [3: if the actor is in an enterable vehicle ( called the carriage ) , now the vehicle gone by is the carriage] if (((ContainerOf(actor) ofclass K27_vehicle) && (t_0=(ContainerOf(actor)), true) && (Adj_50_t1_v64(ContainerOf(actor))))) { (MStack-->MstVO(20007,3)) = t_0; } ! phrase 4 ! [4: let the target be nothing] t_1 = nothing; ! phrase 5 ! [5: if the noun is a direction begin] if (((noun ofclass K3_direction))) { ! phrase 6 ! [6: let direction d be the noun] t_2 = noun; ! phrase 7 ! [7: let the target be the room-or-door direction d from the room gone from] t_1 = (Resolver_0(t_2,(MStack-->MstVO(20007,0)),"source", 2312)); ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: if the noun is a door , let the target be the noun] if (((noun ofclass K4_door))) { t_1 = noun; } ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: if the target is a door begin] if (((t_1 ofclass K4_door))) { ! phrase 12 ! [12: now the door gone through is the target] (MStack-->MstVO(20007,2)) = t_1; ! phrase 13 ! [13: now the target is the other side of the target from the room gone from] t_1 = (Resolver_1(t_1,(MStack-->MstVO(20007,0)),"source", 2317)); ! phrase 14 ! [14: end if] } ! phrase 15 ! [15: now the room gone to is the target] (MStack-->MstVO(20007,1)) = t_1; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_123, 123, true); rfalse; ]; ! From the Standard Rules ! Setting action variables for looking ( this is the determine visibility ceiling rule ): [ R_155 ; if ((action ==##Look)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_155, 155); ! phrase 1 ! [1: if the actor is the player , calculate visibility ceiling at low level] if (((actor == player))) { FindVisibilityLevels(); } ! phrase 2 ! [2: now the visibility level count is the visibility ceiling count calculated] (MStack-->MstVO(20011,2)) = visibility_levels ; ! phrase 3 ! [3: now the visibility ceiling is the visibility ceiling calculated] (MStack-->MstVO(20011,3)) = visibility_ceiling ; ! phrase 4 ! [4: now the room-describing action is the looking action] (MStack-->MstVO(20011,0)) = ##Look; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_155, 155, true); rfalse; ]; ! From the Standard Rules ! Setting action variables for exiting: [ R_143 ; if ((action ==##Exit)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_143, 143); ! phrase 1 ! [1: now the container exited from is the holder of the actor] (MStack-->MstVO(20009,0)) = (HolderOf(actor)) ; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_143, 143, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: specific action-processing (B10_specific_action_processi) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/8: WORK_OUT_DETAILS_OF_SPECIFIC_R ! --- now the mid-placed rules --- ! Rule 2/8 ! A specific action-processing rule ( this is the investigate player's awareness before action rule ): ! === which is equally specific with === ! Rule 3/8 ! A specific action-processing rule ( this is the check stage rule ): ! === which is equally specific with === ! Rule 4/8 ! A specific action-processing rule ( this is the carry out stage rule ): ! === which is equally specific with === ! Rule 5/8 ! A specific action-processing rule ( this is the after stage rule ): ! === which is equally specific with === ! Rule 6/8 ! A specific action-processing rule ( this is the investigate player's awareness after action rule ): ! === which is equally specific with === ! Rule 7/8 ! A specific action-processing rule ( this is the report stage rule ): ! --- now the last-placed rules --- ! Rule 8/8 ! The last specific action-processing rule: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! A specific action-processing rule ( this is the investigate player's awareness before action rule ): [ R_21 ; ! phrase 1 ! [1: consider the player's action awareness rules] ProcessRulebook(11); ! phrase 2 ! [2: if rule succeeded , change within the player's sight to true] if (( (RulebookSucceeded()) )) { (MStack-->MstVO(10,5)) = 1; } ! phrase 3 ! [3: otherwise change within the player's sight to false] else { (MStack-->MstVO(10,5)) = 0; } rfalse; ]; ! From the Standard Rules ! A specific action-processing rule ( this is the check stage rule ): [ R_22 ; ! phrase 1 ! [1: anonymously abide by the specific check rulebook] if (temporary_value = ProcessRulebook((MStack-->MstVO(10,2)))) { if (RulebookSucceeded()) ActRulebookSucceeds(temporary_value); else ActRulebookFails(temporary_value); rtrue; } rfalse; ]; ! From the Standard Rules ! A specific action-processing rule ( this is the carry out stage rule ): [ R_23 ; ! phrase 1 ! [1: consider the specific carry out rulebook] ProcessRulebook((MStack-->MstVO(10,3))); rfalse; ]; ! From the Standard Rules ! A specific action-processing rule ( this is the after stage rule ): [ R_24 ; ! phrase 1 ! [1: if action in world is true , abide by the after rules] if ((((MStack-->MstVO(10,0)) == 1))) { if (ProcessRulebook(22)) rtrue; } rfalse; ]; ! From the Standard Rules ! A specific action-processing rule ( this is the investigate player's awareness after action rule ): [ R_25 ; ! phrase 1 ! [1: if within the player's sight is false begin] if ((((MStack-->MstVO(10,5)) == 0))) { ! phrase 2 ! [2: consider the player's action awareness rules] ProcessRulebook(11); ! phrase 3 ! [3: if rule succeeded , change within the player's sight to true] if (( (RulebookSucceeded()) )) { (MStack-->MstVO(10,5)) = 1; } ! phrase 4 ! [4: end if] } rfalse; ]; ! From the Standard Rules ! A specific action-processing rule ( this is the report stage rule ): [ R_26 ; ! phrase 1 ! [1: if within the player's sight is true and action keeping silent is false , consider the specific report rulebook] if (((((MStack-->MstVO(10,5)) == 1))) && ((((MStack-->MstVO(10,1)) == 0)))) { ProcessRulebook((MStack-->MstVO(10,4))); } rfalse; ]; ! From the Standard Rules ! The last specific action-processing rule: [ R_27 ; ! phrase 1 ! [1: rule succeeds] RulebookSucceeds(); rtrue; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: player's action awareness (B11_player_s_action_awarenes) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! A player's action awareness rule ( this is the player aware of his own actions rule ): ! === which is equally specific with === ! Rule 2/4 ! A player's action awareness rule ( this is the player aware of actions by visible actors rule ): ! === which is equally specific with === ! Rule 3/4 ! A player's action awareness rule ( this is the player aware of actions on visible nouns rule ): ! === which is equally specific with === ! Rule 4/4 ! A player's action awareness rule ( this is the player aware of actions on visible second nouns rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! A player's action awareness rule ( this is the player aware of his own actions rule ): [ R_28 ; ! phrase 1 ! [1: if the player is the actor , rule succeeds] if (((player == actor))) { RulebookSucceeds(); rtrue; } rfalse; ]; ! From the Standard Rules ! A player's action awareness rule ( this is the player aware of actions by visible actors rule ): [ R_29 ; ! phrase 1 ! [1: if the player is not the actor and the player can see the actor , rule succeeds] if (((~~((player == actor)))) && (((TestVisibility(player,actor))))) { RulebookSucceeds(); rtrue; } rfalse; ]; ! From the Standard Rules ! A player's action awareness rule ( this is the player aware of actions on visible nouns rule ): [ R_30 ; ! phrase 1 ! [1: if the noun is a thing and the player can see the noun , rule succeeds] if ((((noun ofclass K2_thing))) && (((TestVisibility(player,noun))))) { RulebookSucceeds(); rtrue; } rfalse; ]; ! From the Standard Rules ! A player's action awareness rule ( this is the player aware of actions on visible second nouns rule ): [ R_31 ; ! phrase 1 ! [1: if the second noun is a thing and the player can see the second noun , rule succeeds] if ((((second ofclass K2_thing))) && (((TestVisibility(player,second))))) { RulebookSucceeds(); rtrue; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Visibility (B15_visibility) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! The last visibility rule ( this is the can't act in the dark rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! The last visibility rule ( this is the can't act in the dark rule ): [ R_32 ; ! phrase 1 ! [1: if in darkness , rule succeeds] if (( (location==thedark) )) { RulebookSucceeds(); rtrue; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Before (B18_before) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Before behaving randomly: ! >>> III.6.1 - Action/Name/Is This Named >>> ! Rule 2/2 ! Before doing anything: ! ---------------------------------------------------------------------------------------------------- ! From "Dice-lock" by S John Ross ! Before behaving randomly: [ R_801 ; if ((NAP_0()) && (actor==player)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_801, 801); ! phrase 1 ! [1: lock the dice] (PHR_800()); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_801, 801, true); rfalse; ]; ! Before doing anything: [ R_804 ; if ( (actor==player)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_804, 804); ! phrase 1 ! [1: lock the dice] (PHR_800()); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_804, 804, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: Instead (B19_instead) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/22 ! Instead of examining the chorus for the first time: ! >>> I - Number of aspects constrained >>> ! Rule 2/22 ! Instead of examining here-backdrop: ! === which is equally specific with === ! Rule 3/22 ! Instead of examining the chorus: ! === which is equally specific with === ! Rule 4/22 ! Instead of examining your sword: ! >>> III.3.2 - Action/What/Thing Acted On >>> ! Rule 5/22 ! Instead of giving text for no quip chosen: ! === which is equally specific with === ! Rule 6/22 ! Instead of giving text for set_values_1: ! === which is equally specific with === ! Rule 7/22 ! Instead of finding responses to set_values_1: ! === which is equally specific with === ! Rule 8/22 ! Instead of giving link to set_values_2: ! === which is equally specific with === ! Rule 9/22 ! Instead of giving text for set_values_2: ! === which is equally specific with === ! Rule 10/22 ! Instead of finding responses to set_values_2: ! === which is equally specific with === ! Rule 11/22 ! Instead of giving link to set_values_3: ! === which is equally specific with === ! Rule 12/22 ! Instead of giving text for set_values_3: ! === which is equally specific with === ! Rule 13/22 ! Instead of finding responses to set_values_3: ! === which is equally specific with === ! Rule 14/22 ! Instead of giving link to set_values_4: ! === which is equally specific with === ! Rule 15/22 ! Instead of giving text for set_values_4: ! === which is equally specific with === ! Rule 16/22 ! Instead of finding responses to set_values_4: ! === which is equally specific with === ! Rule 17/22 ! Instead of giving link to set_values_5: ! === which is equally specific with === ! Rule 18/22 ! Instead of giving text for set_values_5: ! === which is equally specific with === ! Rule 19/22 ! Instead of giving link to set_values_6: ! === which is equally specific with === ! Rule 20/22 ! Instead of giving text for set_values_6: ! >>> III.3.2 - Action/What/Thing Acted On >>> ! Rule 21/22 ! Instead of examining a natural weapon: ! === which is equally specific with === ! Rule 22/22 ! Instead of examining a spear: ! ---------------------------------------------------------------------------------------------------- ! Instead of examining the chorus for the first time: [ R_950 ; if ((PAPR_0() && (((TimesActionHasHappened-->0) == 1) && (ActionCurrentlyHappeningFlag->0)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_950, 950); ! phrase 1 ! [1: say ~Hi, Orestes! We are your very own chorus of libation bearers, and cute-looking maidens to boot.~] say__p=1;ParaContent(); print (PrintText) SC_116; new_line; .L_Say161; .L_SayX136; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_950, 950, true); rfalse; ]; ! Instead of examining here-backdrop: [ R_743 ; if ((action ==##Examine) && (actor==player) && ((noun == O29_here_backdrop))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_743, 743); ! phrase 1 ! [1: try looking] TryAction(0, player, ##Look, 0, 0);; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_743, 743, true); rfalse; ]; ! Instead of examining the chorus: [ R_951 ; if ((action ==##Examine) && (actor==player) && ((noun == O36_chorus))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_951, 951); ! phrase 1 ! [1: say ~We wave and smile at you. You are our hero!~] say__p=1;ParaContent(); print (PrintText) SC_117; new_line; .L_Say162; .L_SayX137; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_951, 951, true); rfalse; ]; ! Instead of examining your sword: [ R_952 ; if ((action ==##Examine) && (actor==player) && ((noun == O39_your_sword))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_952, 952); ! phrase 1 ! [1: say ~It is as sharp as any piece of iron you are likely to find.[paragraph break][stats of your sword][if the numbers boolean is true][italic type]Special effects:[roman type] none[otherwise]It has no special effects[end if].~] say__p=1;ParaContent(); print (PrintText) SC_118; ParaContent(); DivideParagraphPoint(); new_line; ParaContent(); (PHR_947(O39_your_sword)); if (~~(((((Global_Vars-->56) == 1))))) jump L_Say163; ParaContent(); style underline; ParaContent(); print (PrintText) SC_119; ParaContent(); style roman; ParaContent(); print (PrintText) SC_120; jump L_SayX138; .L_Say163; ParaContent(); print (PrintText) SC_121; .L_Say164; .L_SayX138; ParaContent(); print (PrintText) SC_122; new_line; .L_Say165; .L_SayX139; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_952, 952, true); rfalse; ]; ! From "Simple Chat" by Mark Tilford ! Instead of giving text for no quip chosen: [ R_717 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q53_no_quip_chosen))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_717, 717); ! phrase 1 ! [1: do nothing] ; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_717, 717, true); rfalse; ]; ! Instead of giving text for set_values_1: [ R_954 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q99_set_values_1))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_954, 954); ! phrase 1 ! [1: say ~Tell us, Orestes, how difficult do you want your adventure to be?~] say__p=1;ParaContent(); print (PrintText) SC_123; new_line; .L_Say166; .L_SayX140; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_954, 954, true); rfalse; ]; ! Instead of finding responses to set_values_1: [ R_955 ; if ((action ==##A80_finding_responses_to) && (actor==player) && ((noun == Q99_set_values_1))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_955, 955); ! phrase 1 ! [1: link to set_values_2] (PHR_712(Q100_set_values_2)); ! phrase 2 ! [2: link to set_values_3] (PHR_712(Q101_set_values_3)); ! phrase 3 ! [3: link to set_values_4] (PHR_712(Q102_set_values_4)); RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_955, 955, true); rfalse; ]; ! Instead of giving link to set_values_2: [ R_956 ; if ((action ==##A82_giving_link_to) && (actor==player) && ((noun == Q100_set_values_2))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_956, 956); ! phrase 1 ! [1: say ~I want to go on a [b]power trip[r], slaughtering my enemies without having to face the possibility of defeat!~] say__p=1;ParaContent(); print (PrintText) SC_124; ParaContent(); (PHR_748());ParaContent(); print (PrintText) SC_125; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_126; new_line; .L_Say167; .L_SayX141; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_956, 956, true); rfalse; ]; ! Instead of giving text for set_values_2: [ R_957 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q100_set_values_2))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_957, 957); ! phrase 1 ! [1: now the permanent health of the player is 20] WriteValueProperty(player,p11_permanent_health,20); ! phrase 2 ! [2: now the health of the player is 20] WriteValueProperty(player,p10_health,20); ! phrase 3 ! [3: now the melee of the player is 3] WriteValueProperty(player,p13_melee,3); ! phrase 4 ! [4: now the defence of the player is 9] WriteValueProperty(player,p14_defence,9); ! phrase 5 ! [5: say ~And would you like to see all the numbers involved in tactical combat, or just the prose descriptions?~] say__p=1;ParaContent(); print (PrintText) SC_127; new_line; .L_Say168; .L_SayX142; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_957, 957, true); rfalse; ]; ! Instead of finding responses to set_values_2: [ R_958 ; if ((action ==##A80_finding_responses_to) && (actor==player) && ((noun == Q100_set_values_2))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_958, 958); ! phrase 1 ! [1: link to set_values_5] (PHR_712(Q103_set_values_5)); ! phrase 2 ! [2: link to set_values_6] (PHR_712(Q104_set_values_6)); RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_958, 958, true); rfalse; ]; ! Instead of giving link to set_values_3: [ R_959 ; if ((action ==##A82_giving_link_to) && (actor==player) && ((noun == Q101_set_values_3))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_959, 959); ! phrase 1 ! [1: say ~I want to have a [b]fair fight[r], feeling the exhilaration of achievement while being assured of continuous progress!~] say__p=1;ParaContent(); print (PrintText) SC_128; ParaContent(); (PHR_748());ParaContent(); print (PrintText) SC_129; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_130; new_line; .L_Say169; .L_SayX143; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_959, 959, true); rfalse; ]; ! Instead of giving text for set_values_3: [ R_960 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q101_set_values_3))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_960, 960); ! phrase 1 ! [1: now the permanent health of the player is 14] WriteValueProperty(player,p11_permanent_health,14); ! phrase 2 ! [2: now the health of the player is 14] WriteValueProperty(player,p10_health,14); ! phrase 3 ! [3: now the melee of the player is 1] WriteValueProperty(player,p13_melee,1); ! phrase 4 ! [4: now the defence of the player is 7] WriteValueProperty(player,p14_defence,7); ! phrase 5 ! [5: say ~And would you like to see all the numbers involved in tactical combat, or just the prose descriptions?~] say__p=1;ParaContent(); print (PrintText) SC_127; new_line; .L_Say170; .L_SayX144; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_960, 960, true); rfalse; ]; ! Instead of finding responses to set_values_3: [ R_961 ; if ((action ==##A80_finding_responses_to) && (actor==player) && ((noun == Q101_set_values_3))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_961, 961); ! phrase 1 ! [1: link to set_values_5] (PHR_712(Q103_set_values_5)); ! phrase 2 ! [2: link to set_values_6] (PHR_712(Q104_set_values_6)); RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_961, 961, true); rfalse; ]; ! Instead of giving link to set_values_4: [ R_962 ; if ((action ==##A82_giving_link_to) && (actor==player) && ((noun == Q102_set_values_4))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_962, 962); ! phrase 1 ! [1: say ~I want to play [b]hard core[r], so I can rejoice in my superiority when I look down on the corpses of my enemies!~] say__p=1;ParaContent(); print (PrintText) SC_131; ParaContent(); (PHR_748());ParaContent(); print (PrintText) SC_132; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_133; new_line; .L_Say171; .L_SayX145; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_962, 962, true); rfalse; ]; ! Instead of giving text for set_values_4: [ R_963 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q102_set_values_4))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_963, 963); ! phrase 1 ! [1: now the permanent health of the player is 10] WriteValueProperty(player,p11_permanent_health,10); ! phrase 2 ! [2: now the health of the player is 10] WriteValueProperty(player,p10_health,10); ! phrase 3 ! [3: now the melee of the player is 0] WriteValueProperty(player,p13_melee,0); ! phrase 4 ! [4: now the defence of the player is 6] WriteValueProperty(player,p14_defence,6); ! phrase 5 ! [5: say ~And would you like to see all the numbers involved in tactical combat, or just the prose descriptions?~] say__p=1;ParaContent(); print (PrintText) SC_127; new_line; .L_Say172; .L_SayX146; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_963, 963, true); rfalse; ]; ! Instead of finding responses to set_values_4: [ R_964 ; if ((action ==##A80_finding_responses_to) && (actor==player) && ((noun == Q102_set_values_4))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_964, 964); ! phrase 1 ! [1: link to set_values_5] (PHR_712(Q103_set_values_5)); ! phrase 2 ! [2: link to set_values_6] (PHR_712(Q104_set_values_6)); RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_964, 964, true); rfalse; ]; ! Instead of giving link to set_values_5: [ R_965 ; if ((action ==##A82_giving_link_to) && (actor==player) && ((noun == Q103_set_values_5))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_965, 965); ! phrase 1 ! [1: say ~Numbers scare me! I am a casual gamer!~] say__p=1;ParaContent(); print (PrintText) SC_134; new_line; .L_Say173; .L_SayX147; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_965, 965, true); rfalse; ]; ! Instead of giving text for set_values_5: [ R_966 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q103_set_values_5))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_966, 966); ! phrase 1 ! [1: try switching the numbers off] TryAction(0, player, ##A84_switching_the_numbers_of, 0, 0);; ! phrase 2 ! [2: say ~Very well. You can always switch by typing [i]numbers off[r] and [i]numbers on[r].[pb][pb]~] say__p=1;ParaContent(); print (PrintText) SC_135; ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_136; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_137; ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_138; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_122; new_line;ParaContent(); (PHR_749());ParaContent(); (PHR_749()); .L_Say174; .L_SayX148; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_966, 966, true); rfalse; ]; ! Instead of giving link to set_values_6: [ R_967 ; if ((action ==##A82_giving_link_to) && (actor==player) && ((noun == Q104_set_values_6))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_967, 967); ! phrase 1 ! [1: say ~I don't understand. How can I min-max without numbers?~] say__p=1;ParaContent(); print (PrintText) SC_139; new_line; .L_Say175; .L_SayX149; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_967, 967, true); rfalse; ]; ! Instead of giving text for set_values_6: [ R_968 ; if ((action ==##A81_giving_text_for) && (actor==player) && ((noun == Q104_set_values_6))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_968, 968); ! phrase 1 ! [1: try switching the numbers on] TryAction(0, player, ##A85_switching_the_numbers_on, 0, 0);; ! phrase 2 ! [2: say ~Very well. You can always switch by typing [i]numbers off[r] and [i]numbers on[r].[pb][pb]~] say__p=1;ParaContent(); print (PrintText) SC_135; ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_136; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_137; ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_138; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_122; new_line;ParaContent(); (PHR_749());ParaContent(); (PHR_749()); .L_Say176; .L_SayX150; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_968, 968, true); rfalse; ]; ! Instead of examining a natural weapon: [ R_929 ; if ((action ==##Examine) && (actor==player) && ((noun ofclass K32_natural_weapon))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_929, 929); ! phrase 1 ! [1: say ~Clenched fists, kicking feet--that kind of stuff.~] say__p=1;ParaContent(); print (PrintText) SC_140; new_line; .L_Say177; .L_SayX151; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_929, 929, true); rfalse; ]; ! Instead of examining a spear: [ R_946 ; if ((action ==##Examine) && (actor==player) && ((noun ofclass K35_spear))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_946, 946); ! phrase 1 ! [1: say ~Bronze-tipped and eight feet long.[paragraph break][stats of the noun][if the numbers boolean is true][italic type]Special effects:[roman type] none[otherwise]It has no special effects[end if].~] say__p=1;ParaContent(); print (PrintText) SC_141; ParaContent(); DivideParagraphPoint(); new_line; ParaContent(); (PHR_947(noun)); if (~~(((((Global_Vars-->56) == 1))))) jump L_Say178; ParaContent(); style underline; ParaContent(); print (PrintText) SC_119; ParaContent(); style roman; ParaContent(); print (PrintText) SC_120; jump L_SayX152; .L_Say178; ParaContent(); print (PrintText) SC_121; .L_Say179; .L_SayX152; ParaContent(); print (PrintText) SC_122; new_line; .L_Say180; .L_SayX153; RulebookFails(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_946, 946, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: After (B22_after) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! After putting on a readied weapon: ! === which is equally specific with === ! Rule 2/3 ! After inserting into a readied weapon: ! >>> III.3.1 - Action/What/Second Thing Acted On >>> ! Rule 3/3 ! After dropping a readied weapon: ! ---------------------------------------------------------------------------------------------------- ! After putting on a readied weapon: [ R_927 ; if ((action ==##PutOn) && (actor==player) && ((second ofclass K31_weapon) && (Adj_81_t1_v64(second)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_927, 927); ! phrase 1 ! [1: now the noun is not readied] Adj_81_t3_v64(noun); ! phrase 2 ! [2: continue the action] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_927, 927, true); rfalse; ]; ! After inserting into a readied weapon: [ R_928 ; if ((action ==##Insert) && (actor==player) && ((second ofclass K31_weapon) && (Adj_81_t1_v64(second)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_928, 928); ! phrase 1 ! [1: now the noun is not readied] Adj_81_t3_v64(noun); ! phrase 2 ! [2: continue the action] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_928, 928, true); rfalse; ]; ! After dropping a readied weapon: [ R_926 ; if ((action ==##Drop) && (actor==player) && ((noun ofclass K31_weapon) && (Adj_81_t1_v64(noun)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_926, 926); ! phrase 1 ! [1: now the noun is not readied] Adj_81_t3_v64(noun); ! phrase 2 ! [2: continue the action] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_926, 926, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: does the player mean (B24_does_the_player_mean) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Does the player mean reloading an unloaded readied weapon enclosed by the player: ! >>> III.3.2 - Action/What/Thing Acted On >>> ! Rule 2/3 ! Does the player mean reloading an unloaded weapon enclosed by the player: ! >>> III.3.2 - Action/What/Thing Acted On >>> ! Rule 3/3 ! Does the player mean taking something which is carried by the player ( this is the very unlikely to mean taking what's already carried rule ): ! ---------------------------------------------------------------------------------------------------- ! Does the player mean reloading an unloaded readied weapon enclosed by the player: [ R_940 ; if ((action ==##A90_reloading) && (actor==player) && ((noun ofclass K31_weapon) && (Adj_22_t1_v64(noun)) && (Adj_81_t1_v64(noun)) && (IndirectlyContains(player,noun)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_940, 940); ! phrase 1 ! [1: it is very likely] RulebookSucceeds(true, RBNO_6); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_940, 940, true); rfalse; ]; ! Does the player mean reloading an unloaded weapon enclosed by the player: [ R_941 ; if ((action ==##A90_reloading) && (actor==player) && ((noun ofclass K31_weapon) && (Adj_22_t1_v64(noun)) && (IndirectlyContains(player,noun)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_941, 941); ! phrase 1 ! [1: it is likely] RulebookSucceeds(true, RBNO_7); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_941, 941, true); rfalse; ]; ! From the Standard Rules ! Does the player mean taking something which is carried by the player ( this is the very unlikely to mean taking what's already carried rule ): [ R_33 ; if ((action ==##Take) && (actor==player) && ((noun ofclass K2_thing) && (player == CarrierOf(noun)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_33, 33); ! phrase 1 ! [1: it is very unlikely] RulebookSucceeds(true, RBNO_10); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_33, 33, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: before Printing the name (B27_before_printing_the_name) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Before printing the name of a thing ( called the item being printed ) ( this is the make named things mentioned rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Before printing the name of a thing ( called the item being printed ) ( this is the make named things mentioned rule ): [ R_46 t_0 ! Local variable e.g. 'item being printed' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_46, 46); ! phrase 1 ! [1: now the item being printed is mentioned] Adj_48_t2_v64(t_0); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_46, 46, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing the name (B28_for_printing_the_name) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Rule for printing the name of yourself: ! --- now the last-placed rules --- ! Rule 2/2: STANDARD_NAME_PRINTING_R ! ---------------------------------------------------------------------------------------------------- ! Rule for printing the name of yourself: [ R_811 ; if (((parameter_object == selfobj))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_811, 811); ! phrase 1 ! [1: say ~you~] say__p=1;ParaContent(); print (PrintText) SC_54; .L_Say181; .L_SayX154; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_811, 811, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: after Printing the name (B29_after_printing_the_name) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! After printing the name of a readied weapon while taking inventory: ! >>> III.1 - Object To Which Rule Applies >>> ! Rule 2/4 ! After printing the name of a weapon ( called item ) when taking inventory: ! >>> I - Number of aspects constrained >>> ! Rule 3/4 ! After printing the name of an ambiguously plural thing ( called the suspect ): ! >>> III.1 - Object To Which Rule Applies >>> ! Rule 4/4 ! After printing the name of something ( called the target ): ! ---------------------------------------------------------------------------------------------------- ! After printing the name of a readied weapon while taking inventory: [ R_925 ; if (((parameter_object ofclass K31_weapon) && (Adj_81_t1_v64(parameter_object)))) { ! Runs only when pattern matches if (((((action ==##Inv) && (actor==player))))) { ! Runs only while condition holds if (debug_rules) DB_Rule(R_925, 925); ! phrase 1 ! [1: say ~ (readied)~] say__p=1;ParaContent(); print (PrintText) SC_142; .L_Say182; .L_SayX155; } ! Runs only when pattern matches } ! Runs only while condition holds else if (debug_rules > 1) DB_Rule(R_925, 925, true); rfalse; ]; ! After printing the name of a weapon ( called item ) when taking inventory: [ R_937 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K31_weapon))))) { ! Runs only when pattern matches if (((((action ==##Inv) && (actor==player))))) { ! Runs only while condition holds if (debug_rules) DB_Rule(R_937, 937); ! phrase 1 ! [1: if the maximum shots of item is not 0 begin] if ((~~((ValueProperty(t_0,p23_maximum_shots) == 0)))) { ! phrase 2 ! [2: if the current shots of item is not 0 begin] if ((~~((ValueProperty(t_0,p24_current_shots) == 0)))) { ! phrase 3 ! [3: say ~ ([current shots of item] of [maximum shots of item] shots left)~] say__p=1;ParaContent(); print (PrintText) SC_143; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p24_current_shots)); @pull self; ParaContent(); print (PrintText) SC_144; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p23_maximum_shots)); @pull self; ParaContent(); print (PrintText) SC_145; .L_Say183; .L_SayX156; ! phrase 4 ! [4: else] } else { ! phrase 5 ! [5: say ~ (no ammo; [current load time of item] rounds to reload)~] say__p=1;ParaContent(); print (PrintText) SC_146; ParaContent(); @push self; print (say__n=ValueProperty(self=t_0,p26_current_load_time)); @pull self; ParaContent(); print (PrintText) SC_147; .L_Say184; .L_SayX157; ! phrase 6 ! [6: end if] } ! phrase 7 ! [7: end if] } } ! Runs only when pattern matches } ! Runs only while condition holds else if (debug_rules > 1) DB_Rule(R_937, 937, true); rfalse; ]; ! From "Plurality" by Emily Short ! After printing the name of an ambiguously plural thing ( called the suspect ): [ R_795 t_0 ! Local variable e.g. 'suspect' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing) && (Adj_67_t1_v64(parameter_object)))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_795, 795); ! phrase 1 ! [1: if using the manual pronouns option , do nothing] if (( (TestUseOption(19)) )) { ; } ! phrase 2 ! [2: otherwise notice the plurality of the suspect] else { PlugPlural(t_0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_795, 795, true); rfalse; ]; ! From "Plurality" by Emily Short ! After printing the name of something ( called the target ): [ R_753 t_0 ! Local variable e.g. 'target' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_753, 753); ! phrase 1 ! [1: mark target in output] (Resolver_2(t_0,"source", 14)); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_753, 753, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing the plural name (B31_for_printing_the_plural_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Rule for printing the plural name of something ( called the item ) ( this is the standard printing the plural name rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Rule for printing the plural name of something ( called the item ) ( this is the standard printing the plural name rule ): [ R_47 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_47, 47); ! phrase 1 ! [1: say the printed plural name of the item] say__p=1;ParaContent(); @push self; print (PrintText) ValueProperty(self=t_0,plural); @pull self; .L_Say185; .L_SayX158; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_47, 47, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing a number (B34_for_printing_a_number) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Rule for printing a number of something ( called the item ) ( this is the standard printing a number of something rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Rule for printing a number of something ( called the item ) ( this is the standard printing a number of something rule ): [ R_48 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_48, 48); ! phrase 1 ! [1: say ~[listing group size in words] ~] say__p=1;ParaContent(); print (number) say__n=(listing_size); ParaContent(); print (PrintText) SC_42; .L_Say186; .L_SayX159; ! phrase 2 ! [2: carry out the printing the plural name activity with the item] CarryOutActivity(V1_printing_the_plural_name_, t_0); RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_48, 48, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing the announcement of light (B61_for_printing_the_announc) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! This is the look around once light available rule: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the look around once light available rule: [ R_49 ; ! phrase 1 ! [1: try looking] TryAction(0, player, ##Look, 0, 0);; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Deciding whether all includes (B82_for_deciding_whether_all) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Rule for deciding whether all includes scenery: ! >>> III.1 - Object To Which Rule Applies >>> ! Rule 2/2 ! Rule for deciding whether all includes persons: ! ---------------------------------------------------------------------------------------------------- ! Rule for deciding whether all includes scenery: [ R_741 ; if (((Adj_35_t1_v64(parameter_object)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_741, 741); ! phrase 1 ! [1: it does not] RulebookFails(true, RBNO_11); rtrue; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_741, 741, true); rfalse; ]; ! Rule for deciding whether all includes persons: [ R_742 ; if (((parameter_object ofclass K8_person))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_742, 742); ! phrase 1 ! [1: it does not] RulebookFails(true, RBNO_11); rtrue; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_742, 742, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Supplying a missing noun (B94_for_supplying_a_missing_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Rule for supplying a missing noun while an actor smelling ( this is the ambient odour rule ): ! === which is equally specific with === ! Rule 2/3 ! Rule for supplying a missing noun while an actor listening ( this is the ambient sound rule ): ! === which is equally specific with === ! Rule 3/3 ! Rule for supplying a missing noun while an actor going ( this is the block vaguely going rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Rule for supplying a missing noun while an actor smelling ( this is the ambient odour rule ): [ R_50 ; if (((((action ==##Smell) && (act_requester==nothing))))) { ! Runs only while condition holds if (debug_rules) DB_Rule(R_50, 50); ! phrase 1 ! [1: change the noun to the location] noun = real_location; RulebookSucceeds(); rtrue; } ! Runs only while condition holds else if (debug_rules > 1) DB_Rule(R_50, 50, true); rfalse; ]; ! From the Standard Rules ! Rule for supplying a missing noun while an actor listening ( this is the ambient sound rule ): [ R_51 ; if (((((action ==##Listen) && (act_requester==nothing))))) { ! Runs only while condition holds if (debug_rules) DB_Rule(R_51, 51); ! phrase 1 ! [1: change the noun to the location] noun = real_location; RulebookSucceeds(); rtrue; } ! Runs only while condition holds else if (debug_rules > 1) DB_Rule(R_51, 51, true); rfalse; ]; ! From the Standard Rules ! Rule for supplying a missing noun while an actor going ( this is the block vaguely going rule ): [ R_52 ; if (((((action ==##Go) && (act_requester==nothing))))) { ! Runs only while condition holds if (debug_rules) DB_Rule(R_52, 52); ! phrase 1 ! [1: issue library message going action number 7] GL__M(##Go,7,noun); RulebookSucceeds(); rtrue; } ! Runs only while condition holds else if (debug_rules > 1) DB_Rule(R_52, 52, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: before Handling the final question (B111_before_handling_the_fin) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! This is the print the final question rule: ! === which is equally specific with === ! Rule 2/3 ! This is the print the final prompt rule: ! --- now the last-placed rules --- ! Rule 3/3: READ_FINAL_ANSWER_R ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the print the final question rule: [ R_54 t_0 ! Local variable e.g. 'named options count' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_2 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: let named options count be 0] t_0 = 0; ! phrase 2 ! [2: repeat through the table of final question options begin] @push ct_0; @push ct_1; for (t_1=T0_final_question_options,t_2=1,ct_0=t_1,ct_1=t_2: t_2<=TableRows(t_1):t_2++,ct_0=t_1,ct_1=t_2) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 3 ! [3: if the only if victorious entry is false or the game ended in victory begin] if ((((TableLookUpEntry(ct_0,101,ct_1) == 0))) || (( (deadflag==2) ))) { ! phrase 4 ! [4: if there is a final response rule entry or the final response activity entry is not empty begin] if ((( (ExistsTableLookUpEntry(ct_0,103,ct_1)) )) || ((~~((Adj_13_t1_v72(TableLookUpEntry(ct_0,104,ct_1))))))) { ! phrase 5 ! [5: if there is a final question wording entry , increase named options count by 1] if (( (ExistsTableLookUpEntry(ct_0,100,ct_1)) )) { t_0 = t_0 + 1; } ! phrase 6 ! [6: end if] } ! phrase 7 ! [7: end if] } ! phrase 8 ! [8: end repeat] } @pull ct_1; @pull ct_0; ! phrase 9 ! [9: if the named options count is less than 1 , abide by the immediately quit rule] if (((t_0 < 1))) { if (ProcessRulebook(IMMEDIATELY_QUIT_R)) rtrue; } ! phrase 10 ! [10: say ~Would you like to ~] say__p=1;ParaContent(); print (PrintText) SC_148; .L_Say187; .L_SayX160; ! phrase 11 ! [11: repeat through the table of final question options begin] @push ct_0; @push ct_1; for (t_1=T0_final_question_options,t_2=1,ct_0=t_1,ct_1=t_2: t_2<=TableRows(t_1):t_2++,ct_0=t_1,ct_1=t_2) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 12 ! [12: if the only if victorious entry is false or the game ended in victory begin] if ((((TableLookUpEntry(ct_0,101,ct_1) == 0))) || (( (deadflag==2) ))) { ! phrase 13 ! [13: if there is a final response rule entry or the final response activity entry is not empty begin] if ((( (ExistsTableLookUpEntry(ct_0,103,ct_1)) )) || ((~~((Adj_13_t1_v72(TableLookUpEntry(ct_0,104,ct_1))))))) { ! phrase 14 ! [14: if there is a final question wording entry begin] if (( (ExistsTableLookUpEntry(ct_0,100,ct_1)) )) { ! phrase 15 ! [15: say final question wording entry] say__p=1;ParaContent(); print (PrintText) TableLookUpEntry(ct_0,100,ct_1); .L_Say188; .L_SayX161; ! phrase 16 ! [16: decrease named options count by 1] t_0 = t_0 - 1; ! phrase 17 ! [17: if the named options count is 0 begin] if (((t_0 == 0))) { ! phrase 18 ! [18: say ~?[line break]~] say__p=1;ParaContent(); print (PrintText) SC_149; ParaContent(); new_line; .L_Say189; .L_SayX162; ! phrase 19 ! [19: otherwise if the named options count is 1] } else if (((t_0 == 1))) { ! phrase 20 ! [20: if using the serial comma option , say ~,~] if (( (TestUseOption(4)) )) { say__p=1;ParaContent(); print (PrintText) SC_150; .L_Say190; .L_SayX163; } ! phrase 21 ! [21: say ~ or ~] say__p=1;ParaContent(); print (PrintText) SC_151; .L_Say191; .L_SayX164; ! phrase 22 ! [22: otherwise] } else { ! phrase 23 ! [23: say ~, ~] say__p=1;ParaContent(); print (PrintText) SC_81; .L_Say192; .L_SayX165; ! phrase 24 ! [24: end if] } ! phrase 25 ! [25: end if] } ! phrase 26 ! [26: end if] } ! phrase 27 ! [27: end if] } ! phrase 28 ! [28: end repeat] } @pull ct_1; @pull ct_0; rfalse; ]; ! From the Standard Rules ! This is the print the final prompt rule: [ R_53 ; ! phrase 1 ! [1: say ~> [run paragraph on]~] say__p=1;ParaContent(); print (PrintText) SC_152; ParaContent(); RunParagraphOn(); .L_Say193; .L_SayX166; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Handling the final question (B112_for_handling_the_final_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! This is the standard respond to final question rule: ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! This is the standard respond to final question rule: [ R_55 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of final question options begin] @push ct_0; @push ct_1; for (t_0=T0_final_question_options,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 2 ! [2: if the only if victorious entry is false or the game ended in victory begin] if ((((TableLookUpEntry(ct_0,101,ct_1) == 0))) || (( (deadflag==2) ))) { ! phrase 3 ! [3: if there is a final response rule entry or the final response activity entry is not empty begin] if ((( (ExistsTableLookUpEntry(ct_0,103,ct_1)) )) || ((~~((Adj_13_t1_v72(TableLookUpEntry(ct_0,104,ct_1))))))) { ! phrase 4 ! [4: if the player's command matches the topic entry begin] if (( (SnippetMatches(players_command, TableLookUpEntry(ct_0,102,ct_1))) )) { ! phrase 5 ! [5: if there is a final response rule entry , abide by final response rule entry] if (( (ExistsTableLookUpEntry(ct_0,103,ct_1)) )) { if (ProcessRulebook(TableLookUpEntry(ct_0,103,ct_1))) rtrue; } ! phrase 6 ! [6: otherwise carry out the final response activity entry activity] else { CarryOutActivity(TableLookUpEntry(ct_0,104,ct_1)); } ! phrase 7 ! [7: rule succeeds] RulebookSucceeds(); rtrue; ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: end if] } ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: end repeat] } @pull ct_1; @pull ct_0; ! phrase 12 ! [12: issue miscellaneous library message number 8] GL__M(##Miscellany,8); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: before Printing the locale description (B114_before_printing_the_loc) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Before printing the locale description ( this is the initialise locale description rule ): ! === which is equally specific with === ! Rule 2/2 ! Before printing the locale description ( this is the find notable locale objects rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Before printing the locale description ( this is the initialise locale description rule ): [ R_58 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: now the locale paragraph count is 0] (Global_Vars-->39) = 0; ! phrase 2 ! [2: repeat with item running through things begin] for (t_0=Prop_13(0), t_1=Prop_13(t_0): t_0: t_0=t_1, t_1=Prop_13(t_1)) { ! phrase 3 ! [3: now the item is not mentioned] Adj_48_t3_v64(t_0); ! phrase 4 ! [4: end repeat] } ! phrase 5 ! [5: repeat through the table of locale priorities begin] @push ct_0; @push ct_1; for (t_0=T1_locale_priorities,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 6 ! [6: blank out the whole row] TableBlankOutRow(ct_0, ct_1); ! phrase 7 ! [7: end repeat] } @pull ct_1; @pull ct_0; rfalse; ]; ! From the Standard Rules ! Before printing the locale description ( this is the find notable locale objects rule ): [ R_59 t_0 ! Local variable e.g. 'domain' = OBJECT_TY ; ! phrase 1 ! [1: let the domain be the parameter-object] t_0 = parameter_object; ! phrase 2 ! [2: carry out the choosing notable locale objects activity with the domain] CarryOutActivity(V30_choosing_notable_locale_, t_0); ! phrase 3 ! [3: continue the activity] rfalse; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing the locale description (B115_for_printing_the_locale) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! For printing the locale description ( this is the interesting locale paragraphs rule ): ! === which is equally specific with === ! Rule 2/2 ! For printing the locale description ( this is the you-can-also-see rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! For printing the locale description ( this is the interesting locale paragraphs rule ): [ R_60 t_0 ! Local variable e.g. 'domain' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_2 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: let the domain be the parameter-object] t_0 = parameter_object; ! phrase 2 ! [2: sort the table of locale priorities in locale description priority order] TableSort(T1_locale_priorities, 106, 1); ! phrase 3 ! [3: repeat through the table of locale priorities begin] @push ct_0; @push ct_1; for (t_1=T1_locale_priorities,t_2=1,ct_0=t_1,ct_1=t_2: t_2<=TableRows(t_1):t_2++,ct_0=t_1,ct_1=t_2) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 4 ! [4: carry out the printing a locale paragraph about activity with the notable-object entry] CarryOutActivity(V31_printing_a_locale_paragr, TableLookUpEntry(ct_0,105,ct_1)); ! phrase 5 ! [5: end repeat] } @pull ct_1; @pull ct_0; ! phrase 6 ! [6: continue the activity] rfalse; RulebookSucceeds(); rtrue; rfalse; ]; ! From the Standard Rules ! For printing the locale description ( this is the you-can-also-see rule ): [ R_61 t_0 ! Local variable e.g. 'domain' = OBJECT_TY t_1 ! Local variable e.g. 'mentionable count' = NUMBER_TY t_2 ! Local variable e.g. 'common holder' = OBJECT_TY t_3 ! Local variable e.g. 'contents form of list' = TRUTH_STATE_TY t_4 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_5 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: let the domain be the parameter-object] t_0 = parameter_object; ! phrase 2 ! [2: let the mentionable count be 0] t_1 = 0; ! phrase 3 ! [3: repeat with item running through things begin] for (t_2=Prop_14(0), t_3=Prop_14(t_2): t_2: t_2=t_3, t_3=Prop_14(t_3)) { ! phrase 4 ! [4: now the item is not marked for listing] Adj_46_t3_v64(t_2); ! phrase 5 ! [5: end repeat] } ! phrase 6 ! [6: repeat through the table of locale priorities begin] @push ct_0; @push ct_1; for (t_2=T1_locale_priorities,t_3=1,ct_0=t_2,ct_1=t_3: t_3<=TableRows(t_2):t_3++,ct_0=t_2,ct_1=t_3) if (TableRowIsBlank(ct_0,ct_1)==false) { ! phrase 7 ! [7: if the locale description priority entry is greater than 0 , now the notable-object entry is marked for listing] if (((TableLookUpEntry(ct_0,106,ct_1) > 0))) { Adj_46_t2_v64(TableLookUpEntry(ct_0,105,ct_1)); } ! phrase 8 ! [8: increase the mentionable count by 1] t_1 = t_1 + 1; ! phrase 9 ! [9: end repeat] } @pull ct_1; @pull ct_0; ! phrase 10 ! [10: if the mentionable count is greater than 0 begin] if (((t_1 > 0))) { ! phrase 11 ! [11: repeat with item running through things begin] for (t_4=Prop_15(0), t_5=Prop_15(t_4): t_4: t_4=t_5, t_5=Prop_15(t_5)) { ! phrase 12 ! [12: if the item is mentioned begin] if (((Adj_48_t1_v64(t_4)))) { ! phrase 13 ! [13: now the item is not marked for listing] Adj_46_t3_v64(t_4); ! phrase 14 ! [14: end if] } ! phrase 15 ! [15: end repeat] } ! phrase 16 ! [16: begin the listing nondescript items activity] BeginActivity(V7_listing_nondescript_items); ! phrase 17 ! [17: if the number of marked for listing things is 0 begin] if ((( (Prop_16()) == 0))) { ! phrase 18 ! [18: abandon the listing nondescript items activity] AbandonActivity(V7_listing_nondescript_items); ! phrase 19 ! [19: otherwise] } else { ! phrase 20 ! [20: if handling the listing nondescript items activity begin] if (( (~~(ForActivity(V7_listing_nondescript_items))) )) { ! phrase 21 ! [21: if the domain is a room begin] if (((t_0 ofclass K1_room))) { ! phrase 22 ! [22: if the domain is the location , say ~You ~] if (((t_0 == real_location))) { say__p=1;ParaContent(); print (PrintText) SC_153; .L_Say194; .L_SayX167; } ! phrase 23 ! [23: otherwise say ~In [the domain] you ~] else { say__p=1;ParaContent(); print (PrintText) SC_154; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_155; .L_Say195; .L_SayX168; } ! phrase 24 ! [24: otherwise if the domain is a supporter] } else if (((t_0 ofclass K6_supporter))) { ! phrase 25 ! [25: say ~On [the domain] you ~] say__p=1;ParaContent(); print (PrintText) SC_156; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_155; .L_Say196; .L_SayX169; ! phrase 26 ! [26: otherwise if the domain is an animal] } else if (((t_0 ofclass K25_animal))) { ! phrase 27 ! [27: say ~On [the domain] you ~] say__p=1;ParaContent(); print (PrintText) SC_156; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_155; .L_Say197; .L_SayX170; ! phrase 28 ! [28: otherwise] } else { ! phrase 29 ! [29: say ~In [the domain] you ~] say__p=1;ParaContent(); print (PrintText) SC_154; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_155; .L_Say198; .L_SayX171; ! phrase 30 ! [30: end if] } ! phrase 31 ! [31: say ~can [if the locale paragraph count is greater than 0]also [end if]see ~] say__p=1;ParaContent(); print (PrintText) SC_157; if (~~(((((Global_Vars-->39) > 0))))) jump L_Say199; ParaContent(); print (PrintText) SC_158; .L_Say199; .L_SayX172; ParaContent(); print (PrintText) SC_159; .L_Say200; .L_SayX173; ! phrase 32 ! [32: let the common holder be nothing] t_2 = nothing; ! phrase 33 ! [33: let contents form of list be true] t_3 = 1; ! phrase 34 ! [34: repeat with list item running through marked for listing things begin] for (t_4=Prop_17(0), t_5=Prop_17(t_4): t_4: t_4=t_5, t_5=Prop_17(t_5)) { ! phrase 35 ! [35: if the holder of the list item is not the common holder begin] if ((~~(( (HolderOf(t_4)) == t_2)))) { ! phrase 36 ! [36: if the common holder is nothing , now the common holder is the holder of the list item] if (((t_2 == nothing))) { t_2 = (HolderOf(t_4)) ; } ! phrase 37 ! [37: otherwise now contents form of list is false] else { t_3 = 0; } ! phrase 38 ! [38: end if] } ! phrase 39 ! [39: if the list item is mentioned , now the list item is not marked for listing] if (((Adj_48_t1_v64(t_4)))) { Adj_46_t3_v64(t_4); } ! phrase 40 ! [40: end repeat] } ! phrase 41 ! [41: filter list recursion to unmentioned things] list_filter_routine = Prop_18; ! phrase 42 ! [42: if contents form of list is true and the common holder is not nothing , list the contents of the common holder , as a sentence , including contents , giving brief inventory information , tersely , not listing concealed items , listing marked items only] if ((((t_3 == 1))) && ((~~((t_2 == nothing))))) { WriteListFrom(child(t_2), 2776); } ! phrase 43 ! [43: otherwise say ~[a list of marked for listing things including contents]~] else { say__p=1;ParaContent(); @push subst__v; objectloop (subst__v ofclass Object) if (((subst__v ofclass K2_thing) && (Adj_46_t1_v64(subst__v)))) give subst__v workflag2; else give subst__v ~workflag2; WriteListOfMarkedObjects(ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+ TERSE_BIT+CONCEAL_BIT); @pull subst__v; .L_Say201; .L_SayX174; } ! phrase 44 ! [44: if the domain is the location , say ~ here~] if (((t_0 == real_location))) { say__p=1;ParaContent(); print (PrintText) SC_160; .L_Say202; .L_SayX175; } ! phrase 45 ! [45: say ~.[paragraph break]~] say__p=1;ParaContent(); print (PrintText) SC_122; ParaContent(); DivideParagraphPoint(); new_line; .L_Say203; .L_SayX176; ! phrase 46 ! [46: unfilter list recursion] list_filter_routine = 0; ! phrase 47 ! [47: end if] } ! phrase 48 ! [48: end the listing nondescript items activity] EndActivity(V7_listing_nondescript_items); ! phrase 49 ! [49: end if] } ! phrase 50 ! [50: end if] } ! phrase 51 ! [51: continue the activity] rfalse; RulebookSucceeds(); rtrue; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Choosing notable locale objects (B118_for_choosing_notable_lo) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! For choosing notable locale objects ( this is the standard notable locale objects rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! For choosing notable locale objects ( this is the standard notable locale objects rule ): [ R_62 t_0 ! Local variable e.g. 'domain' = OBJECT_TY t_1 ! Local variable e.g. 'held item' = OBJECT_TY ; ! phrase 1 ! [1: let the domain be the parameter-object] t_0 = parameter_object; ! phrase 2 ! [2: let the held item be the first thing held by the domain] t_1 = (child(t_0)) ; ! phrase 3 ! [3: while the held item is a thing begin] while (((t_1 ofclass K2_thing))) { ! phrase 4 ! [4: set the locale priority of the held item to 5] (PHR_57(t_1,5)); ! phrase 5 ! [5: now the held item is the next thing held after the held item] t_1 = (sibling(t_1)) ; ! phrase 6 ! [6: end while] } ! phrase 7 ! [7: continue the activity] rfalse; RulebookSucceeds(); rtrue; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: for Printing a locale paragraph about (B121_for_printing_a_locale_p) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention player's supporter in room descriptions rule ): ! === which is equally specific with === ! Rule 2/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention scenery in room descriptions rule ): ! === which is equally specific with === ! Rule 3/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention undescribed items in room descriptions rule ): ! === which is equally specific with === ! Rule 4/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the set pronouns from items in room descriptions rule ): ! === which is equally specific with === ! Rule 5/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the offer items to writing a paragraph about rule ): ! === which is equally specific with === ! Rule 6/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the use initial appearance in room descriptions rule ): ! === which is equally specific with === ! Rule 7/7 ! For printing a locale paragraph about a thing ( called the item ) ( this is the describe what's on scenery supporters in room descriptions rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention player's supporter in room descriptions rule ): [ R_63 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_63, 63); ! phrase 1 ! [1: if the item encloses the player , set the locale priority of the item to 0] if (((IndirectlyContains(t_0,player)))) { (PHR_57(t_0,0)); } ! phrase 2 ! [2: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_63, 63, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention scenery in room descriptions rule ): [ R_64 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_64, 64); ! phrase 1 ! [1: if the item is scenery , set the locale priority of the item to 0] if (((Adj_35_t1_v64(t_0)))) { (PHR_57(t_0,0)); } ! phrase 2 ! [2: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_64, 64, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the don't mention undescribed items in room descriptions rule ): [ R_65 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_65, 65); ! phrase 1 ! [1: if the item is undescribed , set the locale priority of the item to 0] if (((Adj_45_t1_v64(t_0)))) { (PHR_57(t_0,0)); } ! phrase 2 ! [2: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_65, 65, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the set pronouns from items in room descriptions rule ): [ R_66 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_66, 66); ! phrase 1 ! [1: if the item is not mentioned , set pronouns from the item] if ((~~((Adj_48_t1_v64(t_0))))) { PronounNotice(t_0); } ! phrase 2 ! [2: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_66, 66, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the offer items to writing a paragraph about rule ): [ R_67 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_67, 67); ! phrase 1 ! [1: if the item is not mentioned begin] if ((~~((Adj_48_t1_v64(t_0))))) { ! phrase 2 ! [2: if a paragraph break is pending , say ~[conditional paragraph break]~] if (( (say__p) )) { say__p=1;ParaContent(); DivideParagraphPoint(); .L_Say204; .L_SayX177; } ! phrase 3 ! [3: carry out the writing a paragraph about activity with the item] CarryOutActivity(V6_writing_a_paragraph_about, t_0); ! phrase 4 ! [4: if a paragraph break is pending begin] if (( (say__p) )) { ! phrase 5 ! [5: increase the locale paragraph count by 1] (Global_Vars-->39) = (Global_Vars-->39) + 1; ! phrase 6 ! [6: now the item is mentioned] Adj_48_t2_v64(t_0); ! phrase 7 ! [7: say ~[command clarification break]~] say__p=1;ParaContent(); CommandClarificationBreak(); .L_Say205; .L_SayX178; ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: end if] } ! phrase 10 ! [10: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_67, 67, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the use initial appearance in room descriptions rule ): [ R_68 t_0 ! Local variable e.g. 'item' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_2 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_68, 68); ! phrase 1 ! [1: if the item is not mentioned begin] if ((~~((Adj_48_t1_v64(t_0))))) { ! phrase 2 ! [2: if the item provides the property initial appearance and the item is not handled begin] if ((((WhetherProvides(t_0, false, initial)))) && ((~~((Adj_38_t1_v64(t_0)))))) { ! phrase 3 ! [3: increase the locale paragraph count by 1] (Global_Vars-->39) = (Global_Vars-->39) + 1; ! phrase 4 ! [4: say ~[initial appearance of the item]~] say__p=1;ParaContent(); @push self; print (PrintText) ValueProperty(self=t_0,initial); @pull self; .L_Say206; .L_SayX179; ! phrase 5 ! [5: say ~[paragraph break]~] say__p=1;ParaContent(); DivideParagraphPoint(); new_line; .L_Say207; .L_SayX180; ! phrase 6 ! [6: if a locale-supportable thing is on the item begin] if ((Prop_19(,t_0))) { ! phrase 7 ! [7: repeat with possibility running through things on the item begin] for (t_1=Prop_20(,t_0,0), t_2=Prop_20(,t_0,t_1): t_1: t_1=t_2, t_2=Prop_20(,t_0,t_2)) { ! phrase 8 ! [8: now the possibility is marked for listing] Adj_46_t2_v64(t_1); ! phrase 9 ! [9: if the possibility is mentioned begin] if (((Adj_48_t1_v64(t_1)))) { ! phrase 10 ! [10: now the possibility is not marked for listing] Adj_46_t3_v64(t_1); ! phrase 11 ! [11: end if] } ! phrase 12 ! [12: end repeat] } ! phrase 13 ! [13: say ~On [the item] ~] say__p=1;ParaContent(); print (PrintText) SC_156; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_42; .L_Say208; .L_SayX181; ! phrase 14 ! [14: list the contents of the item , as a sentence , including contents , giving brief inventory information , tersely , not listing concealed items , prefacing with is/are , listing marked items only] WriteListFrom(child(t_0), 3800); ! phrase 15 ! [15: say ~.[paragraph break]~] say__p=1;ParaContent(); print (PrintText) SC_122; ParaContent(); DivideParagraphPoint(); new_line; .L_Say209; .L_SayX182; ! phrase 16 ! [16: end if] } ! phrase 17 ! [17: now the item is mentioned] Adj_48_t2_v64(t_0); ! phrase 18 ! [18: end if] } ! phrase 19 ! [19: end if] } ! phrase 20 ! [20: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_68, 68, true); rfalse; ]; ! From the Standard Rules ! For printing a locale paragraph about a thing ( called the item ) ( this is the describe what's on scenery supporters in room descriptions rule ): [ R_70 t_0 ! Local variable e.g. 'item' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_2 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; if ((t_0 = parameter_object, (((t_0=(parameter_object), true) && (parameter_object ofclass K2_thing))))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_70, 70); ! phrase 1 ! [1: if the item is not undescribed and the item is scenery and the item does not enclose the player begin] if (((~~((Adj_45_t1_v64(t_0))))) && ((((Adj_35_t1_v64(t_0)))) && ((~~((IndirectlyContains(t_0,player))))))) { ! phrase 2 ! [2: set pronouns from the item] PronounNotice(t_0); ! phrase 3 ! [3: if a locale-supportable thing is on the item begin] if ((Prop_21(,t_0))) { ! phrase 4 ! [4: repeat with possibility running through things on the item begin] for (t_1=Prop_22(,t_0,0), t_2=Prop_22(,t_0,t_1): t_1: t_1=t_2, t_2=Prop_22(,t_0,t_2)) { ! phrase 5 ! [5: now the possibility is marked for listing] Adj_46_t2_v64(t_1); ! phrase 6 ! [6: if the possibility is mentioned begin] if (((Adj_48_t1_v64(t_1)))) { ! phrase 7 ! [7: now the possibility is not marked for listing] Adj_46_t3_v64(t_1); ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: end repeat] } ! phrase 10 ! [10: increase the locale paragraph count by 1] (Global_Vars-->39) = (Global_Vars-->39) + 1; ! phrase 11 ! [11: say ~On [the item] ~] say__p=1;ParaContent(); print (PrintText) SC_156; ParaContent(); print (the) t_0; ParaContent(); print (PrintText) SC_42; .L_Say210; .L_SayX183; ! phrase 12 ! [12: list the contents of the item , as a sentence , including contents , giving brief inventory information , tersely , not listing concealed items , prefacing with is/are , listing marked items only] WriteListFrom(child(t_0), 3800); ! phrase 13 ! [13: say ~.[paragraph break]~] say__p=1;ParaContent(); print (PrintText) SC_122; ParaContent(); DivideParagraphPoint(); new_line; .L_Say211; .L_SayX184; ! phrase 14 ! [14: end if] } ! phrase 15 ! [15: end if] } ! phrase 16 ! [16: continue the activity] rfalse; RulebookSucceeds(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_70, 70, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Taking inventory (B124_carry_out_taking_invent) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Carry out taking inventory ( this is the print empty inventory rule ): ! === which is equally specific with === ! Rule 2/3 ! Carry out taking inventory ( this is the print standard inventory rule ): ! === which is equally specific with === ! Rule 3/3 ! Carry out taking inventory ( this is the use inventory to set pronouns rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out taking inventory ( this is the print empty inventory rule ): [ R_71 ; if (actor == player) { if (debug_rules) DB_Rule(R_71, 71); ! phrase 1 ! [1: if the first thing held by the player is nothing , stop the action with library message taking inventory action number 1] if ((( (child(player)) == nothing))) { return GL__M(##Inv,1,noun); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_71, 71, true); rfalse; ]; ! From the Standard Rules ! Carry out taking inventory ( this is the print standard inventory rule ): [ R_72 ; if (actor == player) { if (debug_rules) DB_Rule(R_72, 72); ! phrase 1 ! [1: issue library message taking inventory action number 2] GL__M(##Inv,2,noun); ! phrase 2 ! [2: say ~:[line break]~] say__p=1;ParaContent(); print (PrintText) SC_161; ParaContent(); new_line; .L_Say212; .L_SayX185; ! phrase 3 ! [3: list the contents of the player , with newlines , indented , including contents , giving inventory information , with extra indentation] WriteListFrom(child(player), 8215); } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_72, 72, true); rfalse; ]; ! From the Standard Rules ! Carry out taking inventory ( this is the use inventory to set pronouns rule ): [ R_73 ; if (actor == player) { if (debug_rules) DB_Rule(R_73, 73); ! phrase 1 ! [1: set pronouns from possessions of the player] PronounNoticeHeldObjects(); } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_73, 73, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Taking inventory (B125_report_taking_inventory) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor taking inventory ( this is the report other people taking inventory rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor taking inventory ( this is the report other people taking inventory rule ): [ R_74 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_74, 74); ! phrase 1 ! [1: if the actor is not the player , issue actor-based library message taking inventory action number 5 for the actor] if ((~~((actor == player)))) { AGL__M(##Inv,5,actor); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_74, 74, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Taking (B126_check_taking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/12 ! Check an actor taking ( this is the can't take yourself rule ): ! === which is equally specific with === ! Rule 2/12 ! Check an actor taking ( this is the can't take other people rule ): ! === which is equally specific with === ! Rule 3/12 ! Check an actor taking ( this is the can't take component parts rule ): ! === which is equally specific with === ! Rule 4/12 ! Check an actor taking ( this is the can't take people's possessions rule ): ! === which is equally specific with === ! Rule 5/12 ! Check an actor taking ( this is the can't take items out of play rule ): ! === which is equally specific with === ! Rule 6/12 ! Check an actor taking ( this is the can't take what you're inside rule ): ! === which is equally specific with === ! Rule 7/12 ! Check an actor taking ( this is the can't take what's already taken rule ): ! === which is equally specific with === ! Rule 8/12 ! Check an actor taking ( this is the can't take scenery rule ): ! === which is equally specific with === ! Rule 9/12 ! Check an actor taking ( this is the can only take things rule ): ! === which is equally specific with === ! Rule 10/12 ! Check an actor taking ( this is the can't take what's fixed in place rule ): ! === which is equally specific with === ! Rule 11/12 ! Check an actor taking ( this is the use player's holdall to avoid exceeding carrying capacity rule ): ! === which is equally specific with === ! Rule 12/12 ! Check an actor taking ( this is the can't exceed carrying capacity rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor taking ( this is the can't take yourself rule ): [ R_75 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_75, 75); ! phrase 1 ! [1: if the actor is the noun , stop the action with library message taking action number 2 for the noun] if (((actor == noun))) { return GL__M(##Take,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_75, 75, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take other people rule ): [ R_76 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_76, 76); ! phrase 1 ! [1: if the noun is a person , stop the action with library message taking action number 3 for the noun] if (((noun ofclass K8_person))) { return GL__M(##Take,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_76, 76, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take component parts rule ): [ R_77 t_0 ! Local variable e.g. 'whole' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_77, 77); ! phrase 1 ! [1: if the noun is part of something ( called the whole ) , stop the action with library message taking action number 7 for the whole] if ((((noun.component_parent) ofclass K2_thing) && (t_0=((noun.component_parent)), true))) { return GL__M(##Take,7,t_0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_77, 77, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take people's possessions rule ): [ R_78 t_0 ! Local variable e.g. 'local ceiling' = OBJECT_TY t_1 ! Local variable e.g. 'H' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_78, 78); ! phrase 1 ! [1: let the local ceiling be the common ancestor of the actor with the noun] t_0 = (CommonAncestor(actor, noun)) ; ! phrase 2 ! [2: let h be the not-counting-parts holder of the noun] t_1 = (CoreOfParentOfCoreOf(noun)) ; ! phrase 3 ! [3: while h is not nothing and h is not the local ceiling begin] while (((~~((t_1 == nothing)))) && ((~~((t_1 == t_0))))) { ! phrase 4 ! [4: if h is a person , stop the action with library message taking action number 6 for h] if (((t_1 ofclass K8_person))) { return GL__M(##Take,6,t_1); } ! phrase 5 ! [5: let h be the not-counting-parts holder of h] t_1 = (CoreOfParentOfCoreOf(t_1)) ; ! phrase 6 ! [6: end while] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_78, 78, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take items out of play rule ): [ R_79 t_0 ! Local variable e.g. 'H' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_79, 79); ! phrase 1 ! [1: let h be the noun] t_0 = noun; ! phrase 2 ! [2: while h is not nothing and h is not a room begin] while (((~~((t_0 == nothing)))) && ((~~((t_0 ofclass K1_room))))) { ! phrase 3 ! [3: let h be the not-counting-parts holder of h] t_0 = (CoreOfParentOfCoreOf(t_0)) ; ! phrase 4 ! [4: end while] } ! phrase 5 ! [5: if h is nothing , stop the action with library message taking action number 8 for the noun] if (((t_0 == nothing))) { return GL__M(##Take,8,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_79, 79, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take what you're inside rule ): [ R_80 t_0 ! Local variable e.g. 'local ceiling' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_80, 80); ! phrase 1 ! [1: let the local ceiling be the common ancestor of the actor with the noun] t_0 = (CommonAncestor(actor, noun)) ; ! phrase 2 ! [2: if the local ceiling is the noun , stop the action with library message taking action number 4 for the noun] if (((t_0 == noun))) { return GL__M(##Take,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_80, 80, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take what's already taken rule ): [ R_81 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_81, 81); ! phrase 1 ! [1: if the actor is carrying the noun , stop the action with library message taking action number 5 for the noun] if (((actor == CarrierOf(noun)))) { return GL__M(##Take,5,noun); } ! phrase 2 ! [2: if the actor is wearing the noun , stop the action with library message taking action number 5 for the noun] if (((actor == WearerOf(noun)))) { return GL__M(##Take,5,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_81, 81, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take scenery rule ): [ R_82 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_82, 82); ! phrase 1 ! [1: if the noun is scenery , stop the action with library message taking action number 10 for the noun] if (((Adj_35_t1_v64(noun)))) { return GL__M(##Take,10,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_82, 82, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can only take things rule ): [ R_83 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_83, 83); ! phrase 1 ! [1: if the noun is not a thing , stop the action with library message taking action number 15 for the noun] if ((~~((noun ofclass K2_thing)))) { return GL__M(##Take,15,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_83, 83, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't take what's fixed in place rule ): [ R_84 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_84, 84); ! phrase 1 ! [1: if the noun is fixed in place , stop the action with library message taking action number 11 for the noun] if (((Adj_33_t1_v64(noun)))) { return GL__M(##Take,11,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_84, 84, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the use player's holdall to avoid exceeding carrying capacity rule ): [ R_85 t_0 ! Local variable e.g. 'current working sack' = OBJECT_TY t_1 ! Local variable e.g. 'transferred item' = OBJECT_TY t_2 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_3 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_85, 85); ! phrase 1 ! [1: if the number of things carried by the actor is at least the carrying capacity of the actor begin] if ((( (Prop_23(,actor)) >= ValueProperty(actor,capacity)))) { ! phrase 2 ! [2: if the actor is holding a player's holdall ( called the current working sack ) begin] if ((Prop_24(,actor) && (t_0=deferred_calling_list-->0, true))) { ! phrase 3 ! [3: let the transferred item be nothing] t_1 = nothing; ! phrase 4 ! [4: repeat with the possible item running through things carried by the actor begin] for (t_2=Prop_25(,actor,0), t_3=Prop_25(,actor,t_2): t_2: t_2=t_3, t_3=Prop_25(,actor,t_3)) { ! phrase 5 ! [5: if the possible item is not lit and the possible item is not the current working sack , let the transferred item be the possible item] if (((~~((Adj_29_t1_v64(t_2))))) && ((~~((t_2 == t_0))))) { t_1 = t_2; } ! phrase 6 ! [6: end repeat] } ! phrase 7 ! [7: if the transferred item is not nothing begin] if ((~~((t_1 == nothing)))) { ! phrase 8 ! [8: issue library message taking action number 13 for the transferred item] GL__M(##Take,13,t_1); ! phrase 9 ! [9: silently try the actor trying inserting the transferred item into the current working sack] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Insert, t_1, t_0);; @pull keep_silent; ! phrase 10 ! [10: if the transferred item is not in the current working sack , stop the action] if ((~~((t_0 == ContainerOf(t_1))))) { rtrue; } ! phrase 11 ! [11: end if] } ! phrase 12 ! [12: end if] } ! phrase 13 ! [13: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_85, 85, true); rfalse; ]; ! From the Standard Rules ! Check an actor taking ( this is the can't exceed carrying capacity rule ): [ R_86 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_86, 86); ! phrase 1 ! [1: if the number of things carried by the actor is at least the carrying capacity of the actor , stop the action with library message taking action number 12 for the actor] if ((( (Prop_26(,actor)) >= ValueProperty(actor,capacity)))) { return GL__M(##Take,12,actor); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_86, 86, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Taking (B127_carry_out_taking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor taking ( this is the standard taking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor taking ( this is the standard taking rule ): [ R_87 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_87, 87); ! phrase 1 ! [1: now the actor carries the noun] MoveObject(noun,actor); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_87, 87, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Taking (B128_report_taking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor taking ( this is the standard report taking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor taking ( this is the standard report taking rule ): [ R_88 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_88, 88); ! phrase 1 ! [1: if the actor is the player , issue library message taking action number 1 for the noun] if (((actor == player))) { GL__M(##Take,1,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message taking action number 16 for the noun] else { AGL__M(##Take,16,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_88, 88, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Removing it from (B129_check_removing_it_from) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! Check an actor taking ( this is the can't take component parts rule ): ! <<< I - Number of aspects constrained <<< ! Rule 2/4 ! Check an actor removing something from ( this is the can't remove what's not inside rule ): ! === which is equally specific with === ! Rule 3/4 ! Check an actor removing something from ( this is the can't remove from people rule ): ! === which is equally specific with === ! Rule 4/4 ! Check an actor removing something from ( this is the convert remove to take rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor removing something from ( this is the can't remove what's not inside rule ): [ R_89 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_89, 89); ! phrase 1 ! [1: if the holder of the noun is not the second noun , stop the action with library message removing it from action number 2 for the noun] if ((~~(( (HolderOf(noun)) == second)))) { return GL__M(##Remove,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_89, 89, true); rfalse; ]; ! From the Standard Rules ! Check an actor removing something from ( this is the can't remove from people rule ): [ R_90 t_0 ! Local variable e.g. 'owner' = OBJECT_TY ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_90, 90); ! phrase 1 ! [1: if the holder of the noun is a person ( called the owner ) , stop the action with library message taking action number 6 for the owner] if ((( (HolderOf(noun)) ofclass K8_person) && (t_0=( (HolderOf(noun)) ), true))) { return GL__M(##Take,6,t_0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_90, 90, true); rfalse; ]; ! From the Standard Rules ! Check an actor removing something from ( this is the convert remove to take rule ): [ R_91 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_91, 91); ! phrase 1 ! [1: convert to the taking action on the noun] return GVS_Convert(##Take,noun,0); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_91, 91, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Dropping (B132_check_dropping) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/5 ! Check an actor dropping ( this is the can't drop yourself rule ): ! === which is equally specific with === ! Rule 2/5 ! Check an actor dropping ( this is the can't drop what's already dropped rule ): ! === which is equally specific with === ! Rule 3/5 ! Check an actor dropping ( this is the can't drop what's not held rule ): ! === which is equally specific with === ! Rule 4/5 ! Check an actor dropping ( this is the can't drop clothes being worn rule ): ! === which is equally specific with === ! Rule 5/5 ! Check an actor dropping ( this is the can't drop if this exceeds carrying capacity rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor dropping ( this is the can't drop yourself rule ): [ R_92 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_92, 92); ! phrase 1 ! [1: if the noun is the actor , stop the action with library message putting it on action number 4] if (((noun == actor))) { return GL__M(##PutOn,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_92, 92, true); rfalse; ]; ! From the Standard Rules ! Check an actor dropping ( this is the can't drop what's already dropped rule ): [ R_93 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_93, 93); ! phrase 1 ! [1: if the noun is in the holder of the actor , stop the action with library message dropping action number 1 for the noun] if ((( (HolderOf(actor)) == ContainerOf(noun)))) { return GL__M(##Drop,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_93, 93, true); rfalse; ]; ! From the Standard Rules ! Check an actor dropping ( this is the can't drop what's not held rule ): [ R_94 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_94, 94); ! phrase 1 ! [1: if the actor is carrying the noun , continue the action] if (((actor == CarrierOf(noun)))) { rfalse; } ! phrase 2 ! [2: if the actor is wearing the noun , continue the action] if (((actor == WearerOf(noun)))) { rfalse; } ! phrase 3 ! [3: stop the action with library message dropping action number 2 for the noun] return GL__M(##Drop,2,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_94, 94, true); rfalse; ]; ! From the Standard Rules ! Check an actor dropping ( this is the can't drop clothes being worn rule ): [ R_95 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_95, 95); ! phrase 1 ! [1: if the actor is wearing the noun begin] if (((actor == WearerOf(noun)))) { ! phrase 2 ! [2: issue library message dropping action number 3 for the noun] GL__M(##Drop,3,noun); ! phrase 3 ! [3: silently try the actor trying taking off the noun] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Disrobe, noun, 0);; @pull keep_silent; ! phrase 4 ! [4: if the actor is wearing the noun , stop the action] if (((actor == WearerOf(noun)))) { rtrue; } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_95, 95, true); rfalse; ]; ! From the Standard Rules ! Check an actor dropping ( this is the can't drop if this exceeds carrying capacity rule ): [ R_96 t_0 ! Local variable e.g. 'H' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_96, 96); ! phrase 1 ! [1: let h be the holder of the actor] t_0 = (HolderOf(actor)) ; ! phrase 2 ! [2: if h is a room , continue the action] if (((t_0 ofclass K1_room))) { rfalse; } ! phrase 3 ! [3: if h provides the property carrying capacity begin] if (((WhetherProvides(t_0, false, capacity)))) { ! phrase 4 ! [4: if h is a supporter begin] if (((t_0 ofclass K6_supporter))) { ! phrase 5 ! [5: if the number of things on h is at least the carrying capacity of h begin] if ((( (Prop_27(,t_0)) >= ValueProperty(t_0,capacity)))) { ! phrase 6 ! [6: if the actor is the player , issue library message dropping action number 5 for h] if (((actor == player))) { GL__M(##Drop,5,t_0); } ! phrase 7 ! [7: stop the action] rtrue; ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: otherwise if h is a container] } else if (((t_0 ofclass K5_container))) { ! phrase 10 ! [10: if the number of things in h is at least the carrying capacity of h begin] if ((( (Prop_28(,t_0)) >= ValueProperty(t_0,capacity)))) { ! phrase 11 ! [11: if the actor is the player , issue library message dropping action number 6 for h] if (((actor == player))) { GL__M(##Drop,6,t_0); } ! phrase 12 ! [12: stop the action] rtrue; ! phrase 13 ! [13: end if] } ! phrase 14 ! [14: end if] } ! phrase 15 ! [15: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_96, 96, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Dropping (B133_carry_out_dropping) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor dropping ( this is the standard dropping rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor dropping ( this is the standard dropping rule ): [ R_97 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_97, 97); ! phrase 1 ! [1: now the noun is in the holder of the actor] MoveObject(noun, (HolderOf(actor)) ); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_97, 97, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Dropping (B134_report_dropping) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor dropping ( this is the standard report dropping rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor dropping ( this is the standard report dropping rule ): [ R_98 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_98, 98); ! phrase 1 ! [1: if the actor is the player , issue library message dropping action number 4 for the noun] if (((actor == player))) { GL__M(##Drop,4,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message dropping action number 7 for the noun] else { AGL__M(##Drop,7,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_98, 98, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Putting it on (B135_check_putting_it_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/7 ! Check an actor putting something on ( this is the convert put to drop where possible rule ): ! === which is equally specific with === ! Rule 2/7 ! Check an actor putting something on ( this is the can't put what's not held rule ): ! === which is equally specific with === ! Rule 3/7 ! Check an actor putting something on ( this is the can't put something on itself rule ): ! === which is equally specific with === ! Rule 4/7 ! Check an actor putting something on ( this is the can't put onto what's not a supporter rule ): ! === which is equally specific with === ! Rule 5/7 ! Check an actor putting something on ( this is the can't put onto something being carried rule ): ! === which is equally specific with === ! Rule 6/7 ! Check an actor putting something on ( this is the can't put clothes being worn rule ): ! === which is equally specific with === ! Rule 7/7 ! Check an actor putting something on ( this is the can't put if this exceeds carrying capacity rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor putting something on ( this is the convert put to drop where possible rule ): [ R_99 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_99, 99); ! phrase 1 ! [1: if the second noun is down or the actor is on the second noun , convert to the dropping action on the noun] if ((((second == O19_down))) || (((second == SupporterOf(actor))))) { return GVS_Convert(##Drop,noun,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_99, 99, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put what's not held rule ): [ R_100 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_100, 100); ! phrase 1 ! [1: if the actor is carrying the noun , continue the action] if (((actor == CarrierOf(noun)))) { rfalse; } ! phrase 2 ! [2: if the actor is wearing the noun , continue the action] if (((actor == WearerOf(noun)))) { rfalse; } ! phrase 3 ! [3: stop the action with library message putting it on action number 1 for the noun] return GL__M(##PutOn,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_100, 100, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put something on itself rule ): [ R_101 t_0 ! Local variable e.g. 'noun-CPC' = OBJECT_TY t_1 ! Local variable e.g. 'second-CPC' = OBJECT_TY t_2 ! Local variable e.g. 'transfer ceiling' = OBJECT_TY ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_101, 101); ! phrase 1 ! [1: let the noun-cpc be the component parts core of the noun] t_0 = CoreOf(noun) ; ! phrase 2 ! [2: let the second-cpc be the component parts core of the second noun] t_1 = CoreOf(second) ; ! phrase 3 ! [3: let the transfer ceiling be the common ancestor of the noun-cpc with the second-cpc] t_2 = (CommonAncestor(t_0, t_1)) ; ! phrase 4 ! [4: if the transfer ceiling is the noun-cpc , stop the action with library message putting it on action number 2 for the noun] if (((t_2 == t_0))) { return GL__M(##PutOn,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_101, 101, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put onto what's not a supporter rule ): [ R_102 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_102, 102); ! phrase 1 ! [1: if the second noun is not a supporter , stop the action with library message putting it on action number 3 for the second noun] if ((~~((second ofclass K6_supporter)))) { return GL__M(##PutOn,3,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_102, 102, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put onto something being carried rule ): [ R_103 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_103, 103); ! phrase 1 ! [1: if the actor encloses the second noun , stop the action with library message putting it on action number 4 for the second noun] if (((IndirectlyContains(actor,second)))) { return GL__M(##PutOn,4,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_103, 103, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put clothes being worn rule ): [ R_104 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_104, 104); ! phrase 1 ! [1: if the actor is wearing the noun begin] if (((actor == WearerOf(noun)))) { ! phrase 2 ! [2: issue library message putting it on action number 5 for the noun] GL__M(##PutOn,5,noun); ! phrase 3 ! [3: silently try the actor trying taking off the noun] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Disrobe, noun, 0);; @pull keep_silent; ! phrase 4 ! [4: if the actor is wearing the noun , stop the action] if (((actor == WearerOf(noun)))) { rtrue; } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_104, 104, true); rfalse; ]; ! From the Standard Rules ! Check an actor putting something on ( this is the can't put if this exceeds carrying capacity rule ): [ R_105 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_105, 105); ! phrase 1 ! [1: if the second noun provides the property carrying capacity begin] if (((WhetherProvides(second, false, capacity)))) { ! phrase 2 ! [2: if the number of things on the second noun is at least the carrying capacity of the second noun , stop the action with library message putting it on action number 6 for the second noun] if ((( (Prop_29()) >= ValueProperty(second,capacity)))) { return GL__M(##PutOn,6,second); } ! phrase 3 ! [3: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_105, 105, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Putting it on (B136_carry_out_putting_it_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor putting something on ( this is the standard putting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor putting something on ( this is the standard putting rule ): [ R_106 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_106, 106); ! phrase 1 ! [1: now the noun is on the second noun] MoveObject(noun,second); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_106, 106, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Putting it on (B137_report_putting_it_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor putting something on ( this is the concise report putting rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor putting something on ( this is the standard report putting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor putting something on ( this is the concise report putting rule ): [ R_107 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_107, 107); ! phrase 1 ! [1: if the actor is the player and the i6 parser is running multiple actions , stop the action with library message putting it on action number 7 for the noun] if ((((actor == player))) && (( (multiflag==1) ))) { return GL__M(##PutOn,7,noun); } ! phrase 2 ! [2: otherwise continue the action] else { rfalse; } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_107, 107, true); rfalse; ]; ! From the Standard Rules ! Report an actor putting something on ( this is the standard report putting rule ): [ R_108 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_108, 108); ! phrase 1 ! [1: if the actor is the player , issue library message putting it on action number 8 for the noun] if (((actor == player))) { GL__M(##PutOn,8,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message putting it on action number 9 for the noun] else { AGL__M(##PutOn,9,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_108, 108, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Inserting it into (B138_check_inserting_it_into) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/7 ! Check an actor inserting something into ( this is the convert insert to drop where possible rule ): ! === which is equally specific with === ! Rule 2/7 ! Check an actor inserting something into ( this is the can't insert what's not held rule ): ! === which is equally specific with === ! Rule 3/7 ! Check an actor inserting something into ( this is the can't insert something into itself rule ): ! === which is equally specific with === ! Rule 4/7 ! Check an actor inserting something into ( this is the can't insert into closed containers rule ): ! === which is equally specific with === ! Rule 5/7 ! Check an actor inserting something into ( this is the can't insert into what's not a container rule ): ! === which is equally specific with === ! Rule 6/7 ! Check an actor inserting something into ( this is the can't insert clothes being worn rule ): ! === which is equally specific with === ! Rule 7/7 ! Check an actor inserting something into ( this is the can't insert if this exceeds carrying capacity rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor inserting something into ( this is the convert insert to drop where possible rule ): [ R_109 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_109, 109); ! phrase 1 ! [1: if the second noun is down or the actor is in the second noun , convert to the dropping action on the noun] if ((((second == O19_down))) || (((second == ContainerOf(actor))))) { return GVS_Convert(##Drop,noun,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_109, 109, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert what's not held rule ): [ R_110 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_110, 110); ! phrase 1 ! [1: if the actor is carrying the noun , continue the action] if (((actor == CarrierOf(noun)))) { rfalse; } ! phrase 2 ! [2: if the actor is wearing the noun , continue the action] if (((actor == WearerOf(noun)))) { rfalse; } ! phrase 3 ! [3: stop the action with library message inserting it into action number 1 for the noun] return GL__M(##Insert,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_110, 110, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert something into itself rule ): [ R_111 t_0 ! Local variable e.g. 'noun-CPC' = OBJECT_TY t_1 ! Local variable e.g. 'second-CPC' = OBJECT_TY t_2 ! Local variable e.g. 'transfer ceiling' = OBJECT_TY ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_111, 111); ! phrase 1 ! [1: let the noun-cpc be the component parts core of the noun] t_0 = CoreOf(noun) ; ! phrase 2 ! [2: let the second-cpc be the component parts core of the second noun] t_1 = CoreOf(second) ; ! phrase 3 ! [3: let the transfer ceiling be the common ancestor of the noun-cpc with the second-cpc] t_2 = (CommonAncestor(t_0, t_1)) ; ! phrase 4 ! [4: if the transfer ceiling is the noun-cpc , stop the action with library message inserting it into action number 5 for the noun] if (((t_2 == t_0))) { return GL__M(##Insert,5,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_111, 111, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert into closed containers rule ): [ R_112 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_112, 112); ! phrase 1 ! [1: if the second noun is a closed container , stop the action with library message inserting it into action number 3 for the second noun] if (((second ofclass K5_container) && (Adj_54_t1_v64(second)))) { return GL__M(##Insert,3,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_112, 112, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert into what's not a container rule ): [ R_113 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_113, 113); ! phrase 1 ! [1: if the second noun is not a container , stop the action with library message inserting it into action number 2 for the second noun] if ((~~((second ofclass K5_container)))) { return GL__M(##Insert,2,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_113, 113, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert clothes being worn rule ): [ R_114 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_114, 114); ! phrase 1 ! [1: if the actor is wearing the noun begin] if (((actor == WearerOf(noun)))) { ! phrase 2 ! [2: issue library message inserting it into action number 6 for the noun] GL__M(##Insert,6,noun); ! phrase 3 ! [3: silently try the actor trying taking off the noun] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Disrobe, noun, 0);; @pull keep_silent; ! phrase 4 ! [4: if the actor is wearing the noun , stop the action] if (((actor == WearerOf(noun)))) { rtrue; } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_114, 114, true); rfalse; ]; ! From the Standard Rules ! Check an actor inserting something into ( this is the can't insert if this exceeds carrying capacity rule ): [ R_115 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_115, 115); ! phrase 1 ! [1: if the second noun provides the property carrying capacity begin] if (((WhetherProvides(second, false, capacity)))) { ! phrase 2 ! [2: if the number of things in the second noun is at least the carrying capacity of the second noun , stop the action with library message inserting it into action number 7 for the second noun] if ((( (Prop_30()) >= ValueProperty(second,capacity)))) { return GL__M(##Insert,7,second); } ! phrase 3 ! [3: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_115, 115, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Inserting it into (B139_carry_out_inserting_it_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor inserting something into ( this is the standard inserting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor inserting something into ( this is the standard inserting rule ): [ R_116 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_116, 116); ! phrase 1 ! [1: now the noun is in the second noun] MoveObject(noun,second); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_116, 116, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Inserting it into (B140_report_inserting_it_int) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor inserting something into ( this is the concise report inserting rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor inserting something into ( this is the standard report inserting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor inserting something into ( this is the concise report inserting rule ): [ R_117 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_117, 117); ! phrase 1 ! [1: if the actor is the player and the i6 parser is running multiple actions , stop the action with library message inserting it into action number 8 for the noun] if ((((actor == player))) && (( (multiflag==1) ))) { return GL__M(##Insert,8,noun); } ! phrase 2 ! [2: otherwise continue the action] else { rfalse; } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_117, 117, true); rfalse; ]; ! From the Standard Rules ! Report an actor inserting something into ( this is the standard report inserting rule ): [ R_118 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_118, 118); ! phrase 1 ! [1: if the actor is the player , issue library message inserting it into action number 9 for the noun] if (((actor == player))) { GL__M(##Insert,9,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message inserting it into action number 10 for the noun] else { AGL__M(##Insert,10,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_118, 118, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Eating (B141_check_eating) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor eating ( this is the can't eat unless edible rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor eating ( this is the can't eat clothing without removing it first rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor eating ( this is the can't eat unless edible rule ): [ R_119 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_119, 119); ! phrase 1 ! [1: if the noun is not a thing or the noun is not edible , stop the action with library message eating action number 1 for the noun] if (((~~((noun ofclass K2_thing)))) || ((~~((Adj_31_t1_v64(noun)))))) { return GL__M(##Eat,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_119, 119, true); rfalse; ]; ! From the Standard Rules ! Check an actor eating ( this is the can't eat clothing without removing it first rule ): [ R_120 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_120, 120); ! phrase 1 ! [1: if the actor is wearing the noun begin] if (((actor == WearerOf(noun)))) { ! phrase 2 ! [2: issue library message dropping action number 3 for the noun] GL__M(##Drop,3,noun); ! phrase 3 ! [3: try the actor trying taking off the noun] TryAction(0, actor, ##Disrobe, noun, 0);; ! phrase 4 ! [4: if the actor is wearing the noun , stop the action] if (((actor == WearerOf(noun)))) { rtrue; } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_120, 120, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Eating (B142_carry_out_eating) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor eating ( this is the standard eating rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor eating ( this is the standard eating rule ): [ R_121 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_121, 121); ! phrase 1 ! [1: remove the noun from play] RemoveFromPlay(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_121, 121, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Eating (B143_report_eating) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor eating ( this is the standard report eating rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor eating ( this is the standard report eating rule ): [ R_122 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_122, 122); ! phrase 1 ! [1: if the actor is the player , issue library message eating action number 2 for the noun] if (((actor == player))) { GL__M(##Eat,2,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message eating action number 3 for the noun] else { AGL__M(##Eat,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_122, 122, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Going (B144_check_going) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/6 ! Check going south from your room: ! >>> I - Number of aspects constrained >>> ! Rule 2/6 ! Check an actor going ( this is the can't travel in what's not a vehicle rule ): ! === which is equally specific with === ! Rule 3/6 ! Check an actor going ( this is the can't go through undescribed doors rule ): ! === which is equally specific with === ! Rule 4/6 ! Check an actor going ( this is the can't go through closed doors rule ): ! === which is equally specific with === ! Rule 5/6 ! Check an actor going ( this is the determine map connection rule ): ! === which is equally specific with === ! Rule 6/6 ! Check an actor going ( this is the can't go that way rule ): ! ---------------------------------------------------------------------------------------------------- ! Check going south from your room: [ R_953 ; if ( (actor==player) && ((noun == O13_south)) && (((MStack-->MstVON(20007,0)) == O37_your_room)) && ((MStack-->MstVON(20007,1)) ~= nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_953, 953); ! phrase 1 ! [1: if courtyard is unvisited begin] if (((Adj_28_t1_v64(O41_courtyard)))) { ! phrase 2 ! [2: if your sword is not enclosed by the player begin] if ((~~((IndirectlyContains(player,O39_your_sword))))) { ! phrase 3 ! [3: say ~How could you leave without your sword, Orestes?~ instead] say__p=1;ParaContent(); print (PrintText) SC_162; new_line; rtrue; .L_Say213; .L_SayX186; rtrue; ! phrase 4 ! [4: end if] } ! phrase 5 ! [5: if your sword is not readied begin] if ((~~((Adj_81_t1_v64(O39_your_sword))))) { ! phrase 6 ! [6: say ~It is a dangerous world, Orestes. You should ready your sword.[lb][i]To ready a weapon, type 'ready' followed by the name of the weapon. When you attack, you will always use your readied weapon. If you have no weapon readied, you will attack with your bare hands--not a very strategic choice. You can check which weapon is readied by taking inventory[r].~ instead] say__p=1;ParaContent(); print (PrintText) SC_163; new_line;ParaContent(); (PHR_750());ParaContent(); (PHR_746());ParaContent(); print (PrintText) SC_164; ParaContent(); (PHR_747());ParaContent(); print (PrintText) SC_122; new_line; rtrue; .L_Say214; .L_SayX187; rtrue; ! phrase 7 ! [7: otherwise] } else { ! phrase 8 ! [8: run a conversation from set_values_1] (PHR_718(Q99_set_values_1)); ! phrase 9 ! [9: say ~Helios dazzles you as you step outside into the courtyard. We follow you.~] say__p=1;ParaContent(); print (PrintText) SC_165; new_line; .L_Say215; .L_SayX188; ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_953, 953, true); rfalse; ]; ! From the Standard Rules ! Check an actor going ( this is the can't travel in what's not a vehicle rule ): [ R_124 t_0 ! Local variable e.g. 'H' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_124, 124); ! phrase 1 ! [1: let h be the holder of the actor] t_0 = (HolderOf(actor)) ; ! phrase 2 ! [2: if h is the room gone from , continue the action] if (((t_0 == (MStack-->MstVO(20007,0))))) { rfalse; } ! phrase 3 ! [3: if h is the vehicle gone by , continue the action] if (((t_0 == (MStack-->MstVO(20007,3))))) { rfalse; } ! phrase 4 ! [4: stop the action with library message going action number 1 for h] return GL__M(##Go,1,t_0); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_124, 124, true); rfalse; ]; ! From the Standard Rules ! Check an actor going ( this is the can't go through undescribed doors rule ): [ R_125 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_125, 125); ! phrase 1 ! [1: if the door gone through is not nothing and the door gone through is undescribed , stop the action with library message going action number 2 for the room gone from] if (((~~(((MStack-->MstVO(20007,2)) == nothing)))) && (((Adj_45_t1_v64((MStack-->MstVO(20007,2))))))) { return GL__M(##Go,2,(MStack-->MstVO(20007,0))); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_125, 125, true); rfalse; ]; ! From the Standard Rules ! Check an actor going ( this is the can't go through closed doors rule ): [ R_126 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_126, 126); ! phrase 1 ! [1: if the door gone through is not nothing and the door gone through is closed begin] if (((~~(((MStack-->MstVO(20007,2)) == nothing)))) && (((Adj_54_t1_v64((MStack-->MstVO(20007,2))))))) { ! phrase 2 ! [2: if the noun is up , stop the action with library message going action number 3 for the door gone through] if (((noun == O18_up))) { return GL__M(##Go,3,(MStack-->MstVO(20007,2))); } ! phrase 3 ! [3: if the noun is down , stop the action with library message going action number 4 for the door gone through] if (((noun == O19_down))) { return GL__M(##Go,4,(MStack-->MstVO(20007,2))); } ! phrase 4 ! [4: stop the action with library message going action number 5 for the door gone through] return GL__M(##Go,5,(MStack-->MstVO(20007,2))); ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_126, 126, true); rfalse; ]; ! From the Standard Rules ! Check an actor going ( this is the determine map connection rule ): [ R_127 t_0 ! Local variable e.g. 'target' = OBJECT_TY t_1 ! Local variable e.g. 'direction D' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_127, 127); ! phrase 1 ! [1: let the target be nothing] t_0 = nothing; ! phrase 2 ! [2: if the noun is a direction begin] if (((noun ofclass K3_direction))) { ! phrase 3 ! [3: let direction d be the noun] t_1 = noun; ! phrase 4 ! [4: let the target be the room-or-door direction d from the room gone from] t_0 = (Resolver_0(t_1,(MStack-->MstVO(20007,0)),"source", 2343)); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: if the noun is a door , let the target be the noun] if (((noun ofclass K4_door))) { t_0 = noun; } ! phrase 7 ! [7: end if] } ! phrase 8 ! [8: if the target is a door begin] if (((t_0 ofclass K4_door))) { ! phrase 9 ! [9: now the target is the other side of the target from the room gone from] t_0 = (Resolver_1(t_0,(MStack-->MstVO(20007,0)),"source", 2347)); ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: now the room gone to is the target] (MStack-->MstVO(20007,1)) = t_0; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_127, 127, true); rfalse; ]; ! From the Standard Rules ! Check an actor going ( this is the can't go that way rule ): [ R_128 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_128, 128); ! phrase 1 ! [1: if the room gone to is nothing begin] if ((((MStack-->MstVO(20007,1)) == nothing))) { ! phrase 2 ! [2: if the door gone through is nothing , stop the action with library message going action number 2 for the room gone from] if ((((MStack-->MstVO(20007,2)) == nothing))) { return GL__M(##Go,2,(MStack-->MstVO(20007,0))); } ! phrase 3 ! [3: stop the action with library message going action number 6 for the door gone through] return GL__M(##Go,6,(MStack-->MstVO(20007,2))); ! phrase 4 ! [4: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_128, 128, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Going (B145_carry_out_going) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Carry out an actor going ( this is the move player and vehicle rule ): ! === which is equally specific with === ! Rule 2/3 ! Carry out an actor going ( this is the move floating objects rule ): ! === which is equally specific with === ! Rule 3/3 ! Carry out an actor going ( this is the check light in new location rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor going ( this is the move player and vehicle rule ): [ R_129 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_129, 129); ! phrase 1 ! [1: if the vehicle gone by is nothing , surreptitiously move the actor to the room gone to during going] if ((((MStack-->MstVO(20007,3)) == nothing))) { MoveDuringGoing(actor, (MStack-->MstVO(20007,1))); } ! phrase 2 ! [2: otherwise surreptitiously move the vehicle gone by to the room gone to during going] else { MoveDuringGoing((MStack-->MstVO(20007,3)), (MStack-->MstVO(20007,1))); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_129, 129, true); rfalse; ]; ! From the Standard Rules ! Carry out an actor going ( this is the move floating objects rule ): [ R_130 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_130, 130); ! phrase 1 ! [1: if the actor is the player , update backdrop positions] if (((actor == player))) { MoveFloatingObjects(); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_130, 130, true); rfalse; ]; ! From the Standard Rules ! Carry out an actor going ( this is the check light in new location rule ): [ R_131 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_131, 131); ! phrase 1 ! [1: if the actor is the player , surreptitiously reckon darkness] if (((actor == player))) { SilentlyConsiderLight(); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_131, 131, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Going (B146_report_going) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor going ( this is the describe room gone into rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor going ( this is the describe room gone into rule ): [ R_132 t_0 ! Local variable e.g. 'back way' = OBJECT_TY t_1 ! Local variable e.g. 'room back the other way' = OBJECT_TY t_2 ! Local variable e.g. 'room normally this way' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_132, 132); ! phrase 1 ! [1: if the player is the actor begin] if (((player == actor))) { ! phrase 2 ! [2: produce a room description with going spacing conventions] LookAfterGoing(); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: if the noun is a direction begin] if (((noun ofclass K3_direction))) { ! phrase 5 ! [5: if the location is the room gone from begin] if (((real_location == (MStack-->MstVO(20007,0))))) { ! phrase 6 ! [6: if the location is the room gone to begin] if (((real_location == (MStack-->MstVO(20007,1))))) { ! phrase 7 ! [7: continue the action] rfalse; ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: if the noun is up begin] if (((noun == O18_up))) { ! phrase 10 ! [10: issue actor-based library message going action number 8] AGL__M(##Go,8,noun); ! phrase 11 ! [11: otherwise if the noun is down] } else if (((noun == O19_down))) { ! phrase 12 ! [12: issue actor-based library message going action number 9] AGL__M(##Go,9,noun); ! phrase 13 ! [13: otherwise] } else { ! phrase 14 ! [14: issue actor-based library message going action number 10 for the noun] AGL__M(##Go,10,noun); ! phrase 15 ! [15: end if] } ! phrase 16 ! [16: end if] } ! phrase 17 ! [17: otherwise] } else { ! phrase 18 ! [18: let the back way be the opposite of the noun] t_0 = ValueProperty(noun,p6_opposite); ! phrase 19 ! [19: if the location is the room gone to begin] if (((real_location == (MStack-->MstVO(20007,1))))) { ! phrase 20 ! [20: let the room back the other way be the room back way from the location] t_1 = (Resolver_3(t_0,real_location,"source", 2388)); ! phrase 21 ! [21: let the room normally this way be the room noun from the room gone from] t_2 = (Resolver_4(noun,(MStack-->MstVO(20007,0)),"source", 2390)); ! phrase 22 ! [22: if the room back the other way is the room gone from or the room back the other way is the room normally this way begin] if ((((t_1 == (MStack-->MstVO(20007,0))))) || (((t_1 == t_2)))) { ! phrase 23 ! [23: if the back way is up begin] if (((t_0 == O18_up))) { ! phrase 24 ! [24: issue actor-based library message going action number 11] AGL__M(##Go,11,noun); ! phrase 25 ! [25: otherwise if the back way is down] } else if (((t_0 == O19_down))) { ! phrase 26 ! [26: issue actor-based library message going action number 12] AGL__M(##Go,12,noun); ! phrase 27 ! [27: otherwise] } else { ! phrase 28 ! [28: issue actor-based library message going action number 13 for the back way] AGL__M(##Go,13,t_0); ! phrase 29 ! [29: end if] } ! phrase 30 ! [30: otherwise] } else { ! phrase 31 ! [31: issue actor-based library message going action number 14] AGL__M(##Go,14,noun); ! phrase 32 ! [32: end if] } ! phrase 33 ! [33: otherwise] } else { ! phrase 34 ! [34: if the back way is up begin] if (((t_0 == O18_up))) { ! phrase 35 ! [35: issue actor-based library message going action number 15 for the room gone to] AGL__M(##Go,15,(MStack-->MstVO(20007,1))); ! phrase 36 ! [36: otherwise if the back way is down] } else if (((t_0 == O19_down))) { ! phrase 37 ! [37: issue actor-based library message going action number 16 for the room gone to] AGL__M(##Go,16,(MStack-->MstVO(20007,1))); ! phrase 38 ! [38: otherwise] } else { ! phrase 39 ! [39: issue actor-based library message going action number 17 for the room gone to and the back way] AGL__M(##Go,17,(MStack-->MstVO(20007,1)),t_0); ! phrase 40 ! [40: end if] } ! phrase 41 ! [41: end if] } ! phrase 42 ! [42: end if] } ! phrase 43 ! [43: otherwise if the location is the room gone from] } else if (((real_location == (MStack-->MstVO(20007,0))))) { ! phrase 44 ! [44: issue actor-based library message going action number 18 for the noun] AGL__M(##Go,18,noun); ! phrase 45 ! [45: otherwise] } else { ! phrase 46 ! [46: issue actor-based library message going action number 19 for the noun] AGL__M(##Go,19,noun); ! phrase 47 ! [47: end if] } ! phrase 48 ! [48: if the vehicle gone by is not nothing begin] if ((~~(((MStack-->MstVO(20007,3)) == nothing)))) { ! phrase 49 ! [49: say ~ ~] say__p=1;ParaContent(); print (PrintText) SC_42; .L_Say216; .L_SayX189; ! phrase 50 ! [50: if the vehicle gone by is a supporter , issue actor-based library message going action number 20 for the vehicle gone by] if ((((MStack-->MstVO(20007,3)) ofclass K6_supporter))) { AGL__M(##Go,20,(MStack-->MstVO(20007,3))); } ! phrase 51 ! [51: otherwise issue actor-based library message going action number 21 for the vehicle gone by] else { AGL__M(##Go,21,(MStack-->MstVO(20007,3))); } ! phrase 52 ! [52: end if] } ! phrase 53 ! [53: if the thing gone with is not nothing begin] if ((~~(((MStack-->MstVO(20007,4)) == nothing)))) { ! phrase 54 ! [54: if the player is within the thing gone with begin] if ((((MStack-->MstVO(20007,4)) == ContainerOf(player)))) { ! phrase 55 ! [55: issue actor-based library message going action number 22 for the thing gone with] AGL__M(##Go,22,(MStack-->MstVO(20007,4))); ! phrase 56 ! [56: otherwise if the player is within the vehicle gone by] } else if ((((MStack-->MstVO(20007,3)) == ContainerOf(player)))) { ! phrase 57 ! [57: issue actor-based library message going action number 23 for the thing gone with] AGL__M(##Go,23,(MStack-->MstVO(20007,4))); ! phrase 58 ! [58: otherwise if the location is the room gone from] } else if (((real_location == (MStack-->MstVO(20007,0))))) { ! phrase 59 ! [59: issue actor-based library message going action number 24 for the thing gone with] AGL__M(##Go,24,(MStack-->MstVO(20007,4))); ! phrase 60 ! [60: otherwise] } else { ! phrase 61 ! [61: issue actor-based library message going action number 25 for the thing gone with] AGL__M(##Go,25,(MStack-->MstVO(20007,4))); ! phrase 62 ! [62: end if] } ! phrase 63 ! [63: end if] } ! phrase 64 ! [64: if the player is within the vehicle gone by and the player is not within the thing gone with begin] if (((((MStack-->MstVO(20007,3)) == ContainerOf(player)))) && ((~~(((MStack-->MstVO(20007,4)) == ContainerOf(player)))))) { ! phrase 65 ! [65: issue actor-based library message going action number 26] AGL__M(##Go,26,noun); ! phrase 66 ! [66: say ~.~] say__p=1;ParaContent(); print (PrintText) SC_122; new_line; .L_Say217; .L_SayX190; ! phrase 67 ! [67: try looking] TryAction(0, player, ##Look, 0, 0);; ! phrase 68 ! [68: continue the action] rfalse; ! phrase 69 ! [69: end if] } ! phrase 70 ! [70: say ~.~] say__p=1;ParaContent(); print (PrintText) SC_122; new_line; .L_Say218; .L_SayX191; ! phrase 71 ! [71: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_132, 132, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Entering (B147_check_entering) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/7 ! Check an actor entering ( this is the convert enter door into go rule ): ! === which is equally specific with === ! Rule 2/7 ! Check an actor entering ( this is the convert enter compass direction into go rule ): ! === which is equally specific with === ! Rule 3/7 ! Check an actor entering ( this is the can't enter what's already entered rule ): ! === which is equally specific with === ! Rule 4/7 ! Check an actor entering ( this is the can't enter what's not enterable rule ): ! === which is equally specific with === ! Rule 5/7 ! Check an actor entering ( this is the can't enter closed containers rule ): ! === which is equally specific with === ! Rule 6/7 ! Check an actor entering ( this is the can't enter something carried rule ): ! === which is equally specific with === ! Rule 7/7 ! Check an actor entering ( this is the implicitly pass through other barriers rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor entering ( this is the convert enter door into go rule ): [ R_133 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_133, 133); ! phrase 1 ! [1: if the noun is a door , convert to the going action on the noun] if (((noun ofclass K4_door))) { return GVS_Convert(##Go,noun,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_133, 133, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the convert enter compass direction into go rule ): [ R_134 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_134, 134); ! phrase 1 ! [1: if the noun is a direction , convert to the going action on the noun] if (((noun ofclass K3_direction))) { return GVS_Convert(##Go,noun,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_134, 134, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the can't enter what's already entered rule ): [ R_135 t_0 ! Local variable e.g. 'local ceiling' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_135, 135); ! phrase 1 ! [1: let the local ceiling be the common ancestor of the actor with the noun] t_0 = (CommonAncestor(actor, noun)) ; ! phrase 2 ! [2: if the local ceiling is the noun , stop the action with library message entering action number 1 for the noun] if (((t_0 == noun))) { return GL__M(##Enter,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_135, 135, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the can't enter what's not enterable rule ): [ R_136 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_136, 136); ! phrase 1 ! [1: if the noun is not enterable , stop the action with library message entering action number 2 for the noun] if ((~~((Adj_50_t1_v64(noun))))) { return GL__M(##Enter,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_136, 136, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the can't enter closed containers rule ): [ R_137 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_137, 137); ! phrase 1 ! [1: if the noun is a closed container , stop the action with library message entering action number 3 for the noun] if (((noun ofclass K5_container) && (Adj_54_t1_v64(noun)))) { return GL__M(##Enter,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_137, 137, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the can't enter something carried rule ): [ R_138 t_0 ! Local variable e.g. 'local ceiling' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_138, 138); ! phrase 1 ! [1: let the local ceiling be the common ancestor of the actor with the noun] t_0 = (CommonAncestor(actor, noun)) ; ! phrase 2 ! [2: if the local ceiling is the actor , stop the action with library message entering action number 4 for the noun] if (((t_0 == actor))) { return GL__M(##Enter,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_138, 138, true); rfalse; ]; ! From the Standard Rules ! Check an actor entering ( this is the implicitly pass through other barriers rule ): [ R_139 t_0 ! Local variable e.g. 'local ceiling' = OBJECT_TY t_1 ! Local variable e.g. 'target' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_139, 139); ! phrase 1 ! [1: if the holder of the actor is the holder of the noun , continue the action] if ((( (HolderOf(actor)) == (HolderOf(noun)) ))) { rfalse; } ! phrase 2 ! [2: let the local ceiling be the common ancestor of the actor with the noun] t_0 = (CommonAncestor(actor, noun)) ; ! phrase 3 ! [3: while the holder of the actor is not the local ceiling begin] while ((~~(( (HolderOf(actor)) == t_0)))) { ! phrase 4 ! [4: let the target be the holder of the actor] t_1 = (HolderOf(actor)) ; ! phrase 5 ! [5: issue library message entering action number 6 for the target] GL__M(##Enter,6,t_1); ! phrase 6 ! [6: silently try the actor trying exiting] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Exit, 0, 0);; @pull keep_silent; ! phrase 7 ! [7: if the holder of the actor is the target , stop the action] if ((( (HolderOf(actor)) == t_1))) { rtrue; } ! phrase 8 ! [8: end while] } ! phrase 9 ! [9: if the holder of the actor is the noun , stop the action] if ((( (HolderOf(actor)) == noun))) { rtrue; } ! phrase 10 ! [10: if the holder of the actor is the holder of the noun , continue the action] if ((( (HolderOf(actor)) == (HolderOf(noun)) ))) { rfalse; } ! phrase 11 ! [11: let the target be the holder of the noun] t_1 = (HolderOf(noun)) ; ! phrase 12 ! [12: if the noun is part of the target , let the target be the holder of the target] if (((t_1 == (noun.component_parent)))) { t_1 = (HolderOf(t_1)) ; } ! phrase 13 ! [13: while the target is a thing begin] while (((t_1 ofclass K2_thing))) { ! phrase 14 ! [14: if the holder of the target is the local ceiling begin] if ((( (HolderOf(t_1)) == t_0))) { ! phrase 15 ! [15: issue library message entering action number 7 for the target] GL__M(##Enter,7,t_1); ! phrase 16 ! [16: silently try the actor trying entering the target] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Enter, t_1, 0);; @pull keep_silent; ! phrase 17 ! [17: if the holder of the actor is not the target , stop the action] if ((~~(( (HolderOf(actor)) == t_1)))) { rtrue; } ! phrase 18 ! [18: convert to the entering action on the noun] return GVS_Convert(##Enter,noun,0); ! phrase 19 ! [19: continue the action] rfalse; ! phrase 20 ! [20: end if] } ! phrase 21 ! [21: let the target be the holder of the target] t_1 = (HolderOf(t_1)) ; ! phrase 22 ! [22: end while] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_139, 139, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Entering (B148_carry_out_entering) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor entering ( this is the standard entering rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor entering ( this is the standard entering rule ): [ R_140 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_140, 140); ! phrase 1 ! [1: surreptitiously move the actor to the noun] move actor to noun; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_140, 140, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Entering (B149_report_entering) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor entering ( this is the standard report entering rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor entering ( this is the describe contents entered into rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor entering ( this is the standard report entering rule ): [ R_141 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_141, 141); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message entering action number 5 for the noun] GL__M(##Enter,5,noun); ! phrase 3 ! [3: otherwise if the noun is a container] } else if (((noun ofclass K5_container))) { ! phrase 4 ! [4: issue actor-based library message entering action number 8 for the noun] AGL__M(##Enter,8,noun); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: issue actor-based library message entering action number 9 for the noun] AGL__M(##Enter,9,noun); ! phrase 7 ! [7: end if] } ! phrase 8 ! [8: continue the action] rfalse; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_141, 141, true); rfalse; ]; ! From the Standard Rules ! Report an actor entering ( this is the describe contents entered into rule ): [ R_142 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_142, 142); ! phrase 1 ! [1: if the actor is the player , describe locale for the noun] if (((actor == player))) { (PHR_56(noun)); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_142, 142, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Exiting (B150_check_exiting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! Check an actor exiting ( this is the convert exit into go out rule ): ! === which is equally specific with === ! Rule 2/4 ! Check an actor exiting ( this is the can't exit when not inside anything rule ): ! === which is equally specific with === ! Rule 3/4 ! Check an actor exiting ( this is the can't exit closed containers rule ): ! === which is equally specific with === ! Rule 4/4 ! Check an actor exiting ( this is the convert exit into get off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor exiting ( this is the convert exit into go out rule ): [ R_144 t_0 ! Local variable e.g. 'local room' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_144, 144); ! phrase 1 ! [1: let the local room be the location of the actor] t_0 = LocationOf(actor) ; ! phrase 2 ! [2: if the container exited from is the local room begin] if ((((MStack-->MstVO(20009,0)) == t_0))) { ! phrase 3 ! [3: if the room-or-door outside from the local room is not nothing , convert to the going action on the outside] if ((~~(((Resolver_5(out_obj,t_0,"source", 2537)) == nothing)))) { return GVS_Convert(##Go,out_obj,0); } ! phrase 4 ! [4: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_144, 144, true); rfalse; ]; ! From the Standard Rules ! Check an actor exiting ( this is the can't exit when not inside anything rule ): [ R_145 t_0 ! Local variable e.g. 'local room' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_145, 145); ! phrase 1 ! [1: let the local room be the location of the actor] t_0 = LocationOf(actor) ; ! phrase 2 ! [2: if the container exited from is the local room , stop the action with library message exiting action number 1 for the actor] if ((((MStack-->MstVO(20009,0)) == t_0))) { return GL__M(##Exit,1,actor); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_145, 145, true); rfalse; ]; ! From the Standard Rules ! Check an actor exiting ( this is the can't exit closed containers rule ): [ R_146 t_0 ! Local variable e.g. 'cage' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_146, 146); ! phrase 1 ! [1: if the actor is in a closed container ( called the cage ) , stop the action with library message exiting action number 2 for the cage] if (((ContainerOf(actor) ofclass K5_container) && (t_0=(ContainerOf(actor)), true) && (Adj_54_t1_v64(ContainerOf(actor))))) { return GL__M(##Exit,2,t_0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_146, 146, true); rfalse; ]; ! From the Standard Rules ! Check an actor exiting ( this is the convert exit into get off rule ): [ R_147 t_0 ! Local variable e.g. 'platform' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_147, 147); ! phrase 1 ! [1: if the actor is on a supporter ( called the platform ) , convert to the getting off action on the platform] if (((SupporterOf(actor) ofclass K6_supporter) && (t_0=(SupporterOf(actor)), true))) { return GVS_Convert(##GetOff,t_0,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_147, 147, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Exiting (B151_carry_out_exiting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor exiting ( this is the standard exiting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor exiting ( this is the standard exiting rule ): [ R_148 t_0 ! Local variable e.g. 'former exterior' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_148, 148); ! phrase 1 ! [1: let the former exterior be the not-counting-parts holder of the container exited from] t_0 = (CoreOfParentOfCoreOf((MStack-->MstVO(20009,0)))) ; ! phrase 2 ! [2: surreptitiously move the actor to the former exterior] move actor to t_0; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_148, 148, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Exiting (B152_report_exiting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor exiting ( this is the standard report exiting rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor exiting ( this is the describe room emerged into rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor exiting ( this is the standard report exiting rule ): [ R_149 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_149, 149); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message exiting action number 3 for the container exited from] GL__M(##Exit,3,(MStack-->MstVO(20009,0))); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: issue actor-based library message exiting action number 6 for the container exited from] AGL__M(##Exit,6,(MStack-->MstVO(20009,0))); ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: continue the action] rfalse; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_149, 149, true); rfalse; ]; ! From the Standard Rules ! Report an actor exiting ( this is the describe room emerged into rule ): [ R_150 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_150, 150); ! phrase 1 ! [1: if the actor is the player , produce a room description with going spacing conventions] if (((actor == player))) { LookAfterGoing(); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_150, 150, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Getting off (B153_check_getting_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor getting off ( this is the can't get off things rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor getting off ( this is the can't get off things rule ): [ R_151 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_151, 151); ! phrase 1 ! [1: if the actor is on the noun , continue the action] if (((noun == SupporterOf(actor)))) { rfalse; } ! phrase 2 ! [2: if the actor is carried by the noun , continue the action] if (((noun == CarrierOf(actor)))) { rfalse; } ! phrase 3 ! [3: stop the action with library message getting off action number 1 for the noun] return GL__M(##GetOff,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_151, 151, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Getting off (B154_carry_out_getting_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor getting off ( this is the standard getting off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor getting off ( this is the standard getting off rule ): [ R_152 t_0 ! Local variable e.g. 'former exterior' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_152, 152); ! phrase 1 ! [1: let the former exterior be the not-counting-parts holder of the noun] t_0 = (CoreOfParentOfCoreOf(noun)) ; ! phrase 2 ! [2: surreptitiously move the actor to the former exterior] move actor to t_0; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_152, 152, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Getting off (B155_report_getting_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor getting off ( this is the standard report getting off rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor getting off ( this is the describe room stood up into rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor getting off ( this is the standard report getting off rule ): [ R_153 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_153, 153); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message exiting action number 3 for the noun] GL__M(##Exit,3,noun); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: issue actor-based library message exiting action number 5 for the noun] AGL__M(##Exit,5,noun); ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: continue the action] rfalse; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_153, 153, true); rfalse; ]; ! From the Standard Rules ! Report an actor getting off ( this is the describe room stood up into rule ): [ R_154 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_154, 154); ! phrase 1 ! [1: if the actor is the player , produce a room description with going spacing conventions] if (((actor == player))) { LookAfterGoing(); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_154, 154, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Looking (B157_carry_out_looking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! Carry out looking ( this is the room description heading rule ): ! === which is equally specific with === ! Rule 2/4 ! Carry out looking ( this is the room description body text rule ): ! === which is equally specific with === ! Rule 3/4 ! Carry out looking ( this is the room description paragraphs about objects rule ): ! === which is equally specific with === ! Rule 4/4 ! Carry out looking ( this is the check new arrival rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out looking ( this is the room description heading rule ): [ R_156 t_0 ! Local variable e.g. 'intermediate level' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ; if (actor == player) { if (debug_rules) DB_Rule(R_156, 156); ! phrase 1 ! [1: say bold type] say__p=1;ParaContent(); style bold; .L_Say219; .L_SayX192; ! phrase 2 ! [2: if the visibility level count is 0 begin] if ((((MStack-->MstVO(20011,2)) == 0))) { ! phrase 3 ! [3: begin the printing the name of a dark room activity] BeginActivity(V8_printing_the_name_of_a_da); ! phrase 4 ! [4: if handling the printing the name of a dark room activity , issue miscellaneous library message number 71] if (( (~~(ForActivity(V8_printing_the_name_of_a_da))) )) { GL__M(##Miscellany,71); } ! phrase 5 ! [5: end the printing the name of a dark room activity] EndActivity(V8_printing_the_name_of_a_da); ! phrase 6 ! [6: otherwise if the visibility ceiling is the location] } else if ((((MStack-->MstVO(20011,3)) == real_location))) { ! phrase 7 ! [7: say ~[visibility ceiling]~] say__p=1;ParaContent(); print (name) (MStack-->MstVO(20011,3)); .L_Say220; .L_SayX193; ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: say ~[The visibility ceiling]~] say__p=1;ParaContent(); print (The) (MStack-->MstVO(20011,3)); .L_Say221; .L_SayX194; ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: say roman type] say__p=1;ParaContent(); style roman; .L_Say222; .L_SayX195; ! phrase 12 ! [12: let intermediate level be the visibility-holder of the actor] t_0 = VisibilityParent(actor) ; ! phrase 13 ! [13: repeat with intermediate level count running from 2 to the visibility level count begin] for (t_1=2: t_1<=(MStack-->MstVO(20011,2)): t_1++) { ! phrase 14 ! [14: issue library message looking action number 8 for the intermediate level] GL__M(##Look,8,t_0); ! phrase 15 ! [15: let the intermediate level be the visibility-holder of the intermediate level] t_0 = VisibilityParent(t_0) ; ! phrase 16 ! [16: end repeat] } ! phrase 17 ! [17: say line break] say__p=1;ParaContent(); new_line; .L_Say223; .L_SayX196; ! phrase 18 ! [18: say run paragraph on with special look spacing] say__p=1;ParaContent(); SpecialLookSpacingBreak(); .L_Say224; .L_SayX197; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_156, 156, true); rfalse; ]; ! From the Standard Rules ! Carry out looking ( this is the room description body text rule ): [ R_157 ; if (actor == player) { if (debug_rules) DB_Rule(R_157, 157); ! phrase 1 ! [1: if the visibility level count is 0 begin] if ((((MStack-->MstVO(20011,2)) == 0))) { ! phrase 2 ! [2: if set to abbreviated room descriptions , continue the action] if (( (lookmode == 3) )) { rfalse; } ! phrase 3 ! [3: if set to sometimes abbreviated room descriptions and abbreviated form allowed is true and darkness witnessed is true , continue the action] if ((( (lookmode == 1) )) && (((((MStack-->MstVO(20011,1)) == 1))) && ((((Global_Vars-->7) == 1))))) { rfalse; } ! phrase 4 ! [4: begin the printing the description of a dark room activity] BeginActivity(V9_printing_the_description_); ! phrase 5 ! [5: if handling the printing the description of a dark room activity , issue miscellaneous library message number 17] if (( (~~(ForActivity(V9_printing_the_description_))) )) { GL__M(##Miscellany,17); } ! phrase 6 ! [6: end the printing the description of a dark room activity] EndActivity(V9_printing_the_description_); ! phrase 7 ! [7: otherwise if the visibility ceiling is the location] } else if ((((MStack-->MstVO(20011,3)) == real_location))) { ! phrase 8 ! [8: if set to abbreviated room descriptions , continue the action] if (( (lookmode == 3) )) { rfalse; } ! phrase 9 ! [9: if set to sometimes abbreviated room descriptions and abbreviated form allowed is true and the location is visited , continue the action] if ((( (lookmode == 1) )) && (((((MStack-->MstVO(20011,1)) == 1))) && (((Adj_27_t1_v64(real_location)))))) { rfalse; } ! phrase 10 ! [10: print the location's description] PrintOrRun(location, description); ! phrase 11 ! [11: end if] } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_157, 157, true); rfalse; ]; ! From the Standard Rules ! Carry out looking ( this is the room description paragraphs about objects rule ): [ R_158 t_0 ! Local variable e.g. 'intermediate position' = OBJECT_TY t_1 ! Local variable e.g. 'IP count' = NUMBER_TY t_2 ! Local variable e.g. 'top-down IP count' = NUMBER_TY ; if (actor == player) { if (debug_rules) DB_Rule(R_158, 158); ! phrase 1 ! [1: if the visibility level count is greater than 0 begin] if ((((MStack-->MstVO(20011,2)) > 0))) { ! phrase 2 ! [2: let the intermediate position be the actor] t_0 = actor; ! phrase 3 ! [3: let the ip count be the visibility level count] t_1 = (MStack-->MstVO(20011,2)); ! phrase 4 ! [4: while the ip count is greater than 0 begin] while (((t_1 > 0))) { ! phrase 5 ! [5: now the intermediate position is marked for listing] Adj_46_t2_v64(t_0); ! phrase 6 ! [6: let the intermediate position be the visibility-holder of the intermediate position] t_0 = VisibilityParent(t_0) ; ! phrase 7 ! [7: decrease the ip count by 1] t_1 = t_1 - 1; ! phrase 8 ! [8: end while] } ! phrase 9 ! [9: let the top-down ip count be the visibility level count] t_2 = (MStack-->MstVO(20011,2)); ! phrase 10 ! [10: while the top-down ip count is greater than 0 begin] while (((t_2 > 0))) { ! phrase 11 ! [11: let the intermediate position be the actor] t_0 = actor; ! phrase 12 ! [12: let the ip count be 0] t_1 = 0; ! phrase 13 ! [13: while the ip count is less than the top-down ip count begin] while (((t_1 < t_2))) { ! phrase 14 ! [14: let the intermediate position be the visibility-holder of the intermediate position] t_0 = VisibilityParent(t_0) ; ! phrase 15 ! [15: increase the ip count by 1] t_1 = t_1 + 1; ! phrase 16 ! [16: end while] } ! phrase 17 ! [17: describe locale for the intermediate position] (PHR_56(t_0)); ! phrase 18 ! [18: decrease the top-down ip count by 1] t_2 = t_2 - 1; ! phrase 19 ! [19: end while] } ! phrase 20 ! [20: end if] } ! phrase 21 ! [21: continue the action] rfalse; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_158, 158, true); rfalse; ]; ! From the Standard Rules ! Carry out looking ( this is the check new arrival rule ): [ R_159 ; if (actor == player) { if (debug_rules) DB_Rule(R_159, 159); ! phrase 1 ! [1: if in darkness begin] if (( (location==thedark) )) { ! phrase 2 ! [2: now the darkness witnessed is true] (Global_Vars-->7) = 1; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: if the location is a room , now the location is visited] if (((real_location ofclass K1_room))) { Adj_27_t2_v64(real_location); } ! phrase 5 ! [5: end if] } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_159, 159, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Looking (B158_report_looking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor looking ( this is the other people looking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor looking ( this is the other people looking rule ): [ R_160 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_160, 160); ! phrase 1 ! [1: if the actor is not the player , issue actor-based library message looking action number 9] if ((~~((actor == player)))) { AGL__M(##Look,9,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_160, 160, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Examining (B160_carry_out_examining) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/6 ! Carry out examining ( this is the examine undescribed containers rule ): ! === which is equally specific with === ! Rule 2/6 ! Carry out examining ( this is the examine undescribed devices rule ): ! === which is equally specific with === ! Rule 3/6 ! Carry out examining ( this is the examine undescribed things rule ): ! === which is equally specific with === ! Rule 4/6 ! Carry out examining ( this is the examine directions rule ): ! === which is equally specific with === ! Rule 5/6 ! Carry out examining ( this is the standard examining rule ): ! === which is equally specific with === ! Rule 6/6 ! Carry out examining ( this is the examine described devices rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out examining ( this is the examine undescribed containers rule ): [ R_161 ; if (actor == player) { if (debug_rules) DB_Rule(R_161, 161); ! phrase 1 ! [1: if the noun goes undescribed by source text and the noun is a container , convert to the searching action on the noun] if ((( (noun.description == 0) )) && (((noun ofclass K5_container)))) { return GVS_Convert(##Search,noun,0); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_161, 161, true); rfalse; ]; ! From the Standard Rules ! Carry out examining ( this is the examine undescribed devices rule ): [ R_162 ; if (actor == player) { if (debug_rules) DB_Rule(R_162, 162); ! phrase 1 ! [1: if the noun goes undescribed by source text and the noun is a device , stop the action with library message examining action number 3 for the noun] if ((( (noun.description == 0) )) && (((noun ofclass K26_device)))) { return GL__M(##Examine,3,noun); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_162, 162, true); rfalse; ]; ! From the Standard Rules ! Carry out examining ( this is the examine undescribed things rule ): [ R_163 ; if (actor == player) { if (debug_rules) DB_Rule(R_163, 163); ! phrase 1 ! [1: if the noun goes undescribed by source text , stop the action with library message examining action number 2 for the noun] if (( (noun.description == 0) )) { return GL__M(##Examine,2,noun); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_163, 163, true); rfalse; ]; ! From the Standard Rules ! Carry out examining ( this is the examine directions rule ): [ R_164 ; if (actor == player) { if (debug_rules) DB_Rule(R_164, 164); ! phrase 1 ! [1: if the noun is a direction , stop the action with library message examining action number 5 for the noun] if (((noun ofclass K3_direction))) { return GL__M(##Examine,5,noun); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_164, 164, true); rfalse; ]; ! From the Standard Rules ! Carry out examining ( this is the standard examining rule ): [ R_165 ; if (actor == player) { if (debug_rules) DB_Rule(R_165, 165); ! phrase 1 ! [1: say ~[the description of the noun][line break]~] say__p=1;ParaContent(); @push self; print (PrintText) ValueProperty(self=noun,description); @pull self; ParaContent(); new_line; .L_Say225; .L_SayX198; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_165, 165, true); rfalse; ]; ! From the Standard Rules ! Carry out examining ( this is the examine described devices rule ): [ R_166 ; if (actor == player) { if (debug_rules) DB_Rule(R_166, 166); ! phrase 1 ! [1: if the noun is a device , stop the action with library message examining action number 3 for the noun] if (((noun ofclass K26_device))) { return GL__M(##Examine,3,noun); } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_166, 166, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Examining (B161_report_examining) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor examining ( this is the report other people examining rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor examining ( this is the report other people examining rule ): [ R_167 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_167, 167); ! phrase 1 ! [1: if the actor is not the player , issue actor-based library message examining action number 4 for the noun] if ((~~((actor == player)))) { AGL__M(##Examine,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_167, 167, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Looking under (B163_carry_out_looking_under) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor looking under ( this is the standard looking under rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor looking under ( this is the standard looking under rule ): [ R_168 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_168, 168); ! phrase 1 ! [1: stop the action with library message looking under action number 2 for the noun] return GL__M(##LookUnder,2,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_168, 168, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Looking under (B164_report_looking_under) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor looking under ( this is the report other people looking under rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor looking under ( this is the report other people looking under rule ): [ R_169 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_169, 169); ! phrase 1 ! [1: if the actor is not the player , issue actor-based library message looking under action number 3 for the noun] if ((~~((actor == player)))) { AGL__M(##LookUnder,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_169, 169, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Searching (B165_check_searching) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor searching ( this is the can't search unless container or supporter rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor searching ( this is the can't search closed opaque containers rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor searching ( this is the can't search unless container or supporter rule ): [ R_170 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_170, 170); ! phrase 1 ! [1: if the noun is not a container and the noun is not a supporter , stop the action with library message searching action number 4 for the noun] if (((~~((noun ofclass K5_container)))) && ((~~((noun ofclass K6_supporter))))) { return GL__M(##Search,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_170, 170, true); rfalse; ]; ! From the Standard Rules ! Check an actor searching ( this is the can't search closed opaque containers rule ): [ R_171 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_171, 171); ! phrase 1 ! [1: if the noun is a closed opaque container , stop the action with library message searching action number 5 for the noun] if (((noun ofclass K5_container) && (Adj_54_t1_v64(noun)) && (Adj_51_t1_v64(noun)))) { return GL__M(##Search,5,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_171, 171, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Searching (B167_report_searching) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Report searching a container ( this is the standard search containers rule ): ! === which is equally specific with === ! Rule 2/3 ! Report searching a supporter ( this is the standard search supporters rule ): ! >>> I - Number of aspects constrained >>> ! Rule 3/3 ! Report an actor searching ( this is the report other people searching rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report searching a container ( this is the standard search containers rule ): [ R_172 ; if ( (actor==player) && ((noun ofclass K5_container))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_172, 172); ! phrase 1 ! [1: if the noun contains a described thing which is not scenery , issue library message searching action number 7 for the noun] if ((Prop_31())) { GL__M(##Search,7,noun); } ! phrase 2 ! [2: otherwise issue library message searching action number 6 for the noun] else { GL__M(##Search,6,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_172, 172, true); rfalse; ]; ! From the Standard Rules ! Report searching a supporter ( this is the standard search supporters rule ): [ R_173 ; if ( (actor==player) && ((noun ofclass K6_supporter))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_173, 173); ! phrase 1 ! [1: if the noun supports a described thing which is not scenery , issue library message searching action number 3 for the noun] if ((Prop_32())) { GL__M(##Search,3,noun); } ! phrase 2 ! [2: otherwise issue library message searching action number 2 for the noun] else { GL__M(##Search,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_173, 173, true); rfalse; ]; ! From the Standard Rules ! Report an actor searching ( this is the report other people searching rule ): [ R_174 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_174, 174); ! phrase 1 ! [1: if the actor is not the player , issue actor-based library message searching action number 8 for the noun] if ((~~((actor == player)))) { AGL__M(##Search,8,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_174, 174, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Consulting it about (B170_report_consulting_it_ab) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor consulting something about ( this is the block consulting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor consulting something about ( this is the block consulting rule ): [ R_175 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_175, 175); ! phrase 1 ! [1: if the actor is the player , issue library message consulting it about action number 1 for the noun] if (((actor == player))) { GL__M(##Consult,1,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message consulting it about action number 2 for the noun] else { AGL__M(##Consult,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_175, 175, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Locking it with (B171_check_locking_it_with) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! Check an actor locking something with ( this is the can't lock without a lock rule ): ! === which is equally specific with === ! Rule 2/4 ! Check an actor locking something with ( this is the can't lock what's already locked rule ): ! === which is equally specific with === ! Rule 3/4 ! Check an actor locking something with ( this is the can't lock what's open rule ): ! === which is equally specific with === ! Rule 4/4 ! Check an actor locking something with ( this is the can't lock without the correct key rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor locking something with ( this is the can't lock without a lock rule ): [ R_176 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_176, 176); ! phrase 1 ! [1: if the noun provides the property lockable and the noun is lockable , continue the action] if ((((WhetherProvides(noun, true, lockable)))) && (((Adj_57_t1_v64(noun))))) { rfalse; } ! phrase 2 ! [2: stop the action with library message locking it with action number 1 for the noun] return GL__M(##Lock,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_176, 176, true); rfalse; ]; ! From the Standard Rules ! Check an actor locking something with ( this is the can't lock what's already locked rule ): [ R_177 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_177, 177); ! phrase 1 ! [1: if the noun is locked , stop the action with library message locking it with action number 2 for the noun] if (((Adj_58_t1_v64(noun)))) { return GL__M(##Lock,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_177, 177, true); rfalse; ]; ! From the Standard Rules ! Check an actor locking something with ( this is the can't lock what's open rule ): [ R_178 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_178, 178); ! phrase 1 ! [1: if the noun is open , stop the action with library message locking it with action number 3 for the noun] if (((Adj_53_t1_v64(noun)))) { return GL__M(##Lock,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_178, 178, true); rfalse; ]; ! From the Standard Rules ! Check an actor locking something with ( this is the can't lock without the correct key rule ): [ R_179 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_179, 179); ! phrase 1 ! [1: if the holder of the second noun is not the actor or the noun does not provide the property matching key or the matching key of the noun is not the second noun , stop the action with library message locking it with action number 4 for the second noun] if (((~~(( (HolderOf(second)) == actor)))) || (((~~((WhetherProvides(noun, false, with_key))))) || ((~~((ValueProperty(noun,with_key) == second)))))) { return GL__M(##Lock,4,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_179, 179, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Locking it with (B172_carry_out_locking_it_wi) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor locking something with ( this is the standard locking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor locking something with ( this is the standard locking rule ): [ R_180 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_180, 180); ! phrase 1 ! [1: now the noun is locked] Adj_58_t2_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_180, 180, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Locking it with (B173_report_locking_it_with) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor locking something with ( this is the standard report locking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor locking something with ( this is the standard report locking rule ): [ R_181 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_181, 181); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message locking it with action number 5 for the noun] GL__M(##Lock,5,noun); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: if the actor is visible , issue actor-based library message locking it with action number 6 for the noun] if (((Adj_0_t1_v64(actor)))) { AGL__M(##Lock,6,noun); } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_181, 181, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Unlocking it with (B174_check_unlocking_it_with) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor unlocking something with ( this is the can't unlock without a lock rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor unlocking something with ( this is the can't unlock what's already unlocked rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor unlocking something with ( this is the can't unlock without the correct key rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor unlocking something with ( this is the can't unlock without a lock rule ): [ R_182 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_182, 182); ! phrase 1 ! [1: if the noun provides the property lockable and the noun is lockable , continue the action] if ((((WhetherProvides(noun, true, lockable)))) && (((Adj_57_t1_v64(noun))))) { rfalse; } ! phrase 2 ! [2: stop the action with library message unlocking it with action number 1 for the noun] return GL__M(##Unlock,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_182, 182, true); rfalse; ]; ! From the Standard Rules ! Check an actor unlocking something with ( this is the can't unlock what's already unlocked rule ): [ R_183 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_183, 183); ! phrase 1 ! [1: if the noun is not locked , stop the action with library message unlocking it with action number 2 for the noun] if ((~~((Adj_58_t1_v64(noun))))) { return GL__M(##Unlock,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_183, 183, true); rfalse; ]; ! From the Standard Rules ! Check an actor unlocking something with ( this is the can't unlock without the correct key rule ): [ R_184 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_184, 184); ! phrase 1 ! [1: if the holder of the second noun is not the actor or the noun does not provide the property matching key or the matching key of the noun is not the second noun , stop the action with library message unlocking it with action number 3 for the second noun] if (((~~(( (HolderOf(second)) == actor)))) || (((~~((WhetherProvides(noun, false, with_key))))) || ((~~((ValueProperty(noun,with_key) == second)))))) { return GL__M(##Unlock,3,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_184, 184, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Unlocking it with (B175_carry_out_unlocking_it_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor unlocking something with ( this is the standard unlocking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor unlocking something with ( this is the standard unlocking rule ): [ R_185 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_185, 185); ! phrase 1 ! [1: now the noun is not locked] Adj_58_t3_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_185, 185, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Unlocking it with (B176_report_unlocking_it_wit) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor unlocking something with ( this is the standard report unlocking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor unlocking something with ( this is the standard report unlocking rule ): [ R_186 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_186, 186); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message unlocking it with action number 4 for the noun] GL__M(##Unlock,4,noun); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: if the actor is visible , issue actor-based library message unlocking it with action number 5 for the noun] if (((Adj_0_t1_v64(actor)))) { AGL__M(##Unlock,5,noun); } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_186, 186, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Switching on (B177_check_switching_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor switching on ( this is the can't switch on unless switchable rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor switching on ( this is the can't switch on what's already on rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor switching on ( this is the can't switch on unless switchable rule ): [ R_187 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_187, 187); ! phrase 1 ! [1: if the noun provides the property switched on , continue the action] if (((WhetherProvides(noun, true, on)))) { rfalse; } ! phrase 2 ! [2: stop the action with library message switching on action number 1 for the noun] return GL__M(##SwitchOn,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_187, 187, true); rfalse; ]; ! From the Standard Rules ! Check an actor switching on ( this is the can't switch on what's already on rule ): [ R_188 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_188, 188); ! phrase 1 ! [1: if the noun is switched on , stop the action with library message switching on action number 2 for the noun] if (((Adj_63_t1_v64(noun)))) { return GL__M(##SwitchOn,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_188, 188, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Switching on (B178_carry_out_switching_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor switching on ( this is the standard switching on rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor switching on ( this is the standard switching on rule ): [ R_189 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_189, 189); ! phrase 1 ! [1: now the noun is switched on] Adj_63_t2_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_189, 189, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Switching on (B179_report_switching_on) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor switching on ( this is the standard report switching on rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor switching on ( this is the standard report switching on rule ): [ R_190 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_190, 190); ! phrase 1 ! [1: if the actor is the player , issue library message switching on action number 3 for the noun] if (((actor == player))) { GL__M(##SwitchOn,3,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message switching on action number 4 for the noun] else { AGL__M(##SwitchOn,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_190, 190, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Switching off (B180_check_switching_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor switching off ( this is the can't switch off unless switchable rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor switching off ( this is the can't switch off what's already off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor switching off ( this is the can't switch off unless switchable rule ): [ R_191 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_191, 191); ! phrase 1 ! [1: if the noun provides the property switched on , continue the action] if (((WhetherProvides(noun, true, on)))) { rfalse; } ! phrase 2 ! [2: stop the action with library message switching off action number 1 for the noun] return GL__M(##SwitchOff,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_191, 191, true); rfalse; ]; ! From the Standard Rules ! Check an actor switching off ( this is the can't switch off what's already off rule ): [ R_192 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_192, 192); ! phrase 1 ! [1: if the noun is switched off , stop the action with library message switching off action number 2 for the noun] if (((Adj_64_t1_v64(noun)))) { return GL__M(##SwitchOff,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_192, 192, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Switching off (B181_carry_out_switching_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor switching off ( this is the standard switching off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor switching off ( this is the standard switching off rule ): [ R_193 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_193, 193); ! phrase 1 ! [1: now the noun is switched off] Adj_64_t2_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_193, 193, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Switching off (B182_report_switching_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor switching off ( this is the standard report switching off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor switching off ( this is the standard report switching off rule ): [ R_194 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_194, 194); ! phrase 1 ! [1: if the actor is the player , issue library message switching off action number 3 for the noun] if (((actor == player))) { GL__M(##SwitchOff,3,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message switching off action number 4 for the noun] else { AGL__M(##SwitchOff,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_194, 194, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Opening (B183_check_opening) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor opening ( this is the can't open unless openable rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor opening ( this is the can't open what's locked rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor opening ( this is the can't open what's already open rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor opening ( this is the can't open unless openable rule ): [ R_195 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_195, 195); ! phrase 1 ! [1: if the noun provides the property openable and the noun is openable , continue the action] if ((((WhetherProvides(noun, true, openable)))) && (((Adj_55_t1_v64(noun))))) { rfalse; } ! phrase 2 ! [2: stop the action with library message opening action number 1 for the noun] return GL__M(##Open,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_195, 195, true); rfalse; ]; ! From the Standard Rules ! Check an actor opening ( this is the can't open what's locked rule ): [ R_196 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_196, 196); ! phrase 1 ! [1: if the noun provides the property lockable and the noun is locked , stop the action with library message opening action number 2 for the noun] if ((((WhetherProvides(noun, true, lockable)))) && (((Adj_58_t1_v64(noun))))) { return GL__M(##Open,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_196, 196, true); rfalse; ]; ! From the Standard Rules ! Check an actor opening ( this is the can't open what's already open rule ): [ R_197 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_197, 197); ! phrase 1 ! [1: if the noun is open , stop the action with library message opening action number 3 for the noun] if (((Adj_53_t1_v64(noun)))) { return GL__M(##Open,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_197, 197, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Opening (B184_carry_out_opening) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor opening ( this is the standard opening rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor opening ( this is the standard opening rule ): [ R_198 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_198, 198); ! phrase 1 ! [1: now the noun is open] Adj_53_t2_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_198, 198, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Opening (B185_report_opening) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Report an actor opening ( this is the reveal any newly visible interior rule ): ! === which is equally specific with === ! Rule 2/2 ! Report an actor opening ( this is the standard report opening rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor opening ( this is the reveal any newly visible interior rule ): [ R_199 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_199, 199); ! phrase 1 ! [1: if the actor is the player and the noun is an opaque container and the first thing held by the noun is not nothing and the noun does not enclose the actor , stop the action with library message opening action number 4 for the noun] if ((((actor == player))) && ((((noun ofclass K5_container) && (Adj_51_t1_v64(noun)))) && (((~~(( (child(noun)) == nothing)))) && ((~~((IndirectlyContains(noun,actor)))))))) { return GL__M(##Open,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_199, 199, true); rfalse; ]; ! From the Standard Rules ! Report an actor opening ( this is the standard report opening rule ): [ R_200 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_200, 200); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message opening action number 5 for the noun] GL__M(##Open,5,noun); ! phrase 3 ! [3: otherwise if the player can see the actor] } else if (((TestVisibility(player,actor)))) { ! phrase 4 ! [4: issue actor-based library message opening action number 6 for the noun] AGL__M(##Open,6,noun); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: issue actor-based library message opening action number 7 for the noun] AGL__M(##Open,7,noun); ! phrase 7 ! [7: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_200, 200, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Closing (B186_check_closing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor closing ( this is the can't close unless openable rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor closing ( this is the can't close what's already closed rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor closing ( this is the can't close unless openable rule ): [ R_201 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_201, 201); ! phrase 1 ! [1: if the noun provides the property openable and the noun is openable , continue the action] if ((((WhetherProvides(noun, true, openable)))) && (((Adj_55_t1_v64(noun))))) { rfalse; } ! phrase 2 ! [2: stop the action with library message closing action number 1 for the noun] return GL__M(##Close,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_201, 201, true); rfalse; ]; ! From the Standard Rules ! Check an actor closing ( this is the can't close what's already closed rule ): [ R_202 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_202, 202); ! phrase 1 ! [1: if the noun is closed , stop the action with library message closing action number 2 for the noun] if (((Adj_54_t1_v64(noun)))) { return GL__M(##Close,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_202, 202, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Closing (B187_carry_out_closing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor closing ( this is the standard closing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor closing ( this is the standard closing rule ): [ R_203 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_203, 203); ! phrase 1 ! [1: now the noun is closed] Adj_54_t2_v64(noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_203, 203, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Closing (B188_report_closing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor closing ( this is the standard report closing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor closing ( this is the standard report closing rule ): [ R_204 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_204, 204); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message closing action number 3 for the noun] GL__M(##Close,3,noun); ! phrase 3 ! [3: otherwise if the player can see the actor] } else if (((TestVisibility(player,actor)))) { ! phrase 4 ! [4: issue actor-based library message closing action number 4 for the noun] AGL__M(##Close,4,noun); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: issue actor-based library message closing action number 5 for the noun] AGL__M(##Close,5,noun); ! phrase 7 ! [7: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_204, 204, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Wearing (B189_check_wearing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor wearing ( this is the can't wear what's not clothing rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor wearing ( this is the can't wear what's not held rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor wearing ( this is the can't wear what's already worn rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor wearing ( this is the can't wear what's not clothing rule ): [ R_205 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_205, 205); ! phrase 1 ! [1: if the noun is not a thing or the noun is not wearable , stop the action with library message wearing action number 1 for the noun] if (((~~((noun ofclass K2_thing)))) || ((~~((Adj_36_t1_v64(noun)))))) { return GL__M(##Wear,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_205, 205, true); rfalse; ]; ! From the Standard Rules ! Check an actor wearing ( this is the can't wear what's not held rule ): [ R_206 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_206, 206); ! phrase 1 ! [1: if the holder of the noun is not the actor , stop the action with library message wearing action number 2 for the noun] if ((~~(( (HolderOf(noun)) == actor)))) { return GL__M(##Wear,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_206, 206, true); rfalse; ]; ! From the Standard Rules ! Check an actor wearing ( this is the can't wear what's already worn rule ): [ R_207 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_207, 207); ! phrase 1 ! [1: if the actor is wearing the noun , stop the action with library message wearing action number 3 for the noun] if (((actor == WearerOf(noun)))) { return GL__M(##Wear,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_207, 207, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Wearing (B190_carry_out_wearing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor wearing ( this is the standard wearing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor wearing ( this is the standard wearing rule ): [ R_208 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_208, 208); ! phrase 1 ! [1: now the actor wears the noun] WearObject(noun,actor); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_208, 208, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Wearing (B191_report_wearing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor wearing ( this is the standard report wearing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor wearing ( this is the standard report wearing rule ): [ R_209 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_209, 209); ! phrase 1 ! [1: if the actor is the player , issue library message wearing action number 4 for the noun] if (((actor == player))) { GL__M(##Wear,4,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message wearing action number 5 for the noun] else { AGL__M(##Wear,5,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_209, 209, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Taking off (B192_check_taking_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor taking off ( this is the can't take off what's not worn rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor taking off ( this is the can't take off what's not worn rule ): [ R_210 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_210, 210); ! phrase 1 ! [1: if the actor is not wearing the noun , stop the action with library message taking off action number 1 for the noun] if ((~~((actor == WearerOf(noun))))) { return GL__M(##Disrobe,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_210, 210, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Taking off (B193_carry_out_taking_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor taking off ( this is the standard taking off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor taking off ( this is the standard taking off rule ): [ R_211 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_211, 211); ! phrase 1 ! [1: now the actor carries the noun] MoveObject(noun,actor); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_211, 211, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Taking off (B194_report_taking_off) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor taking off ( this is the standard report taking off rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor taking off ( this is the standard report taking off rule ): [ R_212 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_212, 212); ! phrase 1 ! [1: if the actor is the player , issue library message taking off action number 2 for the noun] if (((actor == player))) { GL__M(##Disrobe,2,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message taking off action number 3 for the noun] else { AGL__M(##Disrobe,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_212, 212, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Giving it to (B195_check_giving_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/4 ! Check an actor giving something to ( this is the can't give what you haven't got rule ): ! === which is equally specific with === ! Rule 2/4 ! Check an actor giving something to ( this is the can't give to yourself rule ): ! === which is equally specific with === ! Rule 3/4 ! Check an actor giving something to ( this is the can't give to a non-person rule ): ! === which is equally specific with === ! Rule 4/4 ! Check an actor giving something to ( this is the block giving rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor giving something to ( this is the can't give what you haven't got rule ): [ R_213 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_213, 213); ! phrase 1 ! [1: if the actor is not the holder of the noun , stop the action with library message giving it to action number 1 for the noun] if ((~~((actor == (HolderOf(noun)) )))) { return GL__M(##Give,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_213, 213, true); rfalse; ]; ! From the Standard Rules ! Check an actor giving something to ( this is the can't give to yourself rule ): [ R_214 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_214, 214); ! phrase 1 ! [1: if the actor is the second noun , stop the action with library message giving it to action number 2 for the noun] if (((actor == second))) { return GL__M(##Give,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_214, 214, true); rfalse; ]; ! From the Standard Rules ! Check an actor giving something to ( this is the can't give to a non-person rule ): [ R_215 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_215, 215); ! phrase 1 ! [1: if the second noun is not a person , stop the action with library message giving it to action number 4 for the second noun] if ((~~((second ofclass K8_person)))) { return GL__M(##Give,4,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_215, 215, true); rfalse; ]; ! From the Standard Rules ! Check an actor giving something to ( this is the block giving rule ): [ R_216 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_216, 216); ! phrase 1 ! [1: stop the action with library message giving it to action number 3 for the second noun] return GL__M(##Give,3,second); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_216, 216, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Giving it to (B196_carry_out_giving_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor giving something to ( this is the standard giving rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Carry out an actor giving something to ( this is the standard giving rule ): [ R_217 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_217, 217); ! phrase 1 ! [1: move the noun to the second noun] MoveObject(noun, second, 0, false); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_217, 217, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Giving it to (B197_report_giving_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor giving something to ( this is the standard report giving rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor giving something to ( this is the standard report giving rule ): [ R_218 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_218, 218); ! phrase 1 ! [1: if the actor is the player begin] if (((actor == player))) { ! phrase 2 ! [2: issue library message giving it to action number 5 for the noun] GL__M(##Give,5,noun); ! phrase 3 ! [3: otherwise if the second noun is the player] } else if (((second == player))) { ! phrase 4 ! [4: issue actor-based library message giving it to action number 6 for the noun] AGL__M(##Give,6,noun); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: issue actor-based library message giving it to action number 7 for the noun] AGL__M(##Give,7,noun); ! phrase 7 ! [7: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_218, 218, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Showing it to (B198_check_showing_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor showing something to ( this is the can't show what you haven't got rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor showing something to ( this is the convert show to yourself to examine rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor showing something to ( this is the block showing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor showing something to ( this is the can't show what you haven't got rule ): [ R_219 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_219, 219); ! phrase 1 ! [1: if the actor is not the holder of the noun , stop the action with library message showing it to action number 1 for the noun] if ((~~((actor == (HolderOf(noun)) )))) { return GL__M(##Show,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_219, 219, true); rfalse; ]; ! From the Standard Rules ! Check an actor showing something to ( this is the convert show to yourself to examine rule ): [ R_220 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_220, 220); ! phrase 1 ! [1: if the actor is the second noun , convert to the examining action on the noun] if (((actor == second))) { return GVS_Convert(##Examine,noun,0); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_220, 220, true); rfalse; ]; ! From the Standard Rules ! Check an actor showing something to ( this is the block showing rule ): [ R_221 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_221, 221); ! phrase 1 ! [1: stop the action with library message showing it to action number 2 for the second noun] return GL__M(##Show,2,second); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_221, 221, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Waking (B201_check_waking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor waking ( this is the block waking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor waking ( this is the block waking rule ): [ R_222 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_222, 222); ! phrase 1 ! [1: stop the action with library message waking action number 1 for the noun] return GL__M(##WakeOther,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_222, 222, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Throwing it at (B204_check_throwing_it_at) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor throwing something at ( this is the implicitly remove thrown clothing rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor throwing something at ( this is the futile to throw things at inanimate objects rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor throwing something at ( this is the block throwing at rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor throwing something at ( this is the implicitly remove thrown clothing rule ): [ R_223 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_223, 223); ! phrase 1 ! [1: if the actor is wearing the noun begin] if (((actor == WearerOf(noun)))) { ! phrase 2 ! [2: issue library message dropping action number 3 for the noun] GL__M(##Drop,3,noun); ! phrase 3 ! [3: silently try the actor trying taking off the noun] @push keep_silent; keep_silent=1; TryAction(0, actor, ##Disrobe, noun, 0);; @pull keep_silent; ! phrase 4 ! [4: if the actor is wearing the noun , stop the action] if (((actor == WearerOf(noun)))) { rtrue; } ! phrase 5 ! [5: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_223, 223, true); rfalse; ]; ! From the Standard Rules ! Check an actor throwing something at ( this is the futile to throw things at inanimate objects rule ): [ R_224 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_224, 224); ! phrase 1 ! [1: if the second noun is not a person , stop the action with library message throwing it at action number 1 for the second noun] if ((~~((second ofclass K8_person)))) { return GL__M(##ThrowAt,1,second); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_224, 224, true); rfalse; ]; ! From the Standard Rules ! Check an actor throwing something at ( this is the block throwing at rule ): [ R_225 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_225, 225); ! phrase 1 ! [1: stop the action with library message throwing it at action number 2 for the noun] return GL__M(##ThrowAt,2,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_225, 225, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Attacking (B207_check_attacking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/5 ! A check attacking rule ( this is the only attack persons rule ): ! === which is equally specific with === ! Rule 2/5 ! A check attacking rule ( this is the only attack the living rule ): ! === which is equally specific with === ! Rule 3/5 ! A check attacking rule ( this is the do not attack friendly people rule ): ! === which is equally specific with === ! Rule 4/5 ! A check attacking rule ( this is the do not attack neutral people rule ): ! === which is equally specific with === ! Rule 5/5 ! Check attacking: ! ---------------------------------------------------------------------------------------------------- ! A check attacking rule ( this is the only attack persons rule ): [ R_855 ; if (actor == player) { if (debug_rules) DB_Rule(R_855, 855); ! phrase 1 ! [1: if the noun is not a person , say ~Things are not your enemies.~ instead] if ((~~((noun ofclass K8_person)))) { say__p=1;ParaContent(); print (PrintText) SC_166; new_line; .L_Say226; .L_SayX199; rtrue; } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_855, 855, true); rfalse; ]; ! A check attacking rule ( this is the only attack the living rule ): [ R_856 ; if (actor == player) { if (debug_rules) DB_Rule(R_856, 856); ! phrase 1 ! [1: if the noun is not alive , say ~[The noun] is already dead.~ instead] if ((~~((Adj_20_t1_v64(noun))))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_167; new_line; .L_Say227; .L_SayX200; rtrue; } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_856, 856, true); rfalse; ]; ! A check attacking rule ( this is the do not attack friendly people rule ): [ R_857 ; if (actor == player) { if (debug_rules) DB_Rule(R_857, 857); ! phrase 1 ! [1: if the hostility of the noun is friendly , say ~[The noun] is your friend, not your enemy!~] if (((ValueProperty(noun,p74_hostility) == Q70_friendly))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_168; new_line; .L_Say228; .L_SayX201; } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_857, 857, true); rfalse; ]; ! A check attacking rule ( this is the do not attack neutral people rule ): [ R_858 ; if (actor == player) { if (debug_rules) DB_Rule(R_858, 858); ! phrase 1 ! [1: if the hostility of the noun is neutral , say ~[The noun] is not your enemy.~] if (((ValueProperty(noun,p74_hostility) == Q69_neutral))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_169; new_line; .L_Say229; .L_SayX202; } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_858, 858, true); rfalse; ]; ! Check attacking: [ R_939 t_0 ! Local variable e.g. 'item' = OBJECT_TY ; if (actor == player) { if (debug_rules) DB_Rule(R_939, 939); ! phrase 1 ! [1: let item be a random readied weapon enclosed by the player] t_0 = (Prop_33()) ; ! phrase 2 ! [2: if the maximum shots of item is greater than 0 begin] if (((ValueProperty(t_0,p23_maximum_shots) > 0))) { ! phrase 3 ! [3: if the current shots of item is not greater than 0 , say ~You pull the trigger, but nothing happens--you're out of ammo!~ instead] if ((~~((ValueProperty(t_0,p24_current_shots) > 0)))) { say__p=1;ParaContent(); print (PrintText) SC_170; new_line; .L_Say230; .L_SayX203; rtrue; } ! phrase 4 ! [4: end if] } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_939, 939, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Attacking (B208_carry_out_attacking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Carry out an actor attacking when the fight consequences variable is false: ! === which is equally specific with === ! Rule 2/2 ! Carry out an actor attacking when the fight consequences variable is true: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor attacking when the fight consequences variable is false: [ R_859 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_6(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_6 I7BASPL t_0 ! Local variable e.g. 'n' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; if ((act_requester==nothing) && ((((Global_Vars-->62) == 0)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_859, 859); ! phrase 1 ! [1: if the combat state of the actor is react begin] if (((ValueProperty(actor,p76_combat_state) == Q77_react))) { ! phrase 2 ! [2: now the react state of the actor is aggressive] WriteValueProperty(actor,p77_react_state,Q80_aggressive); ! phrase 3 ! [3: decrease the initiative modifier of the actor by 1] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)-1); ! phrase 4 ! [4: end if] } ! phrase 5 ! [5: consider the attack move flavour rulebook] ProcessRulebook(423); ! phrase 6 ! [6: choose a blank row in the table of stored combat actions] ct_0 = T5_stored_combat_actions; ct_1 = TableBlankRow(ct_0); ! phrase 7 ! [7: now the combat speed entry is 10] TableLookUpEntry(ct_0,113,ct_1,1,10); ! phrase 8 ! [8: if the combat state of the actor is react begin] if (((ValueProperty(actor,p76_combat_state) == Q77_react))) { ! phrase 9 ! [9: let n be a random number between 1 and 7] t_0 = (GenerateRandomNumber(1, 7)) ; ! phrase 10 ! [10: now the combat speed entry is 5 + n] TableLookUpEntry(ct_0,113,ct_1,1, (5+t_0) ); ! phrase 11 ! [11: end if] } ! phrase 12 ! [12: now the combat action entry is the action of the actor attacking the noun] BlkValueCopy(TableLookUpEntry(ct_0,114,ct_1,5), TryAction(0, actor, ##Attack, noun, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 13 ! [13: if the combat state of the noun is not acted , now the combat state of the noun is react] if ((~~((ValueProperty(noun,p76_combat_state) == Q76_acted)))) { WriteValueProperty(noun,p76_combat_state,Q77_react); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_859, 859, true); rfalse; ]; ! Carry out an actor attacking when the fight consequences variable is true: [ R_860 ; if ((act_requester==nothing) && ((((Global_Vars-->62) == 1)))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_860, 860); ! phrase 1 ! [1: if the actor is alive , make the actor strike a blow against the noun] if (((Adj_20_t1_v64(actor)))) { (Resolver_6(actor,noun,"source", 829)); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_860, 860, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Kissing (B210_check_kissing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor kissing ( this is the kissing yourself rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor kissing ( this is the block kissing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor kissing ( this is the kissing yourself rule ): [ R_227 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_227, 227); ! phrase 1 ! [1: if the noun is the actor , stop the action with library message touching action number 3 for the noun] if (((noun == actor))) { return GL__M(##Touch,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_227, 227, true); rfalse; ]; ! From the Standard Rules ! Check an actor kissing ( this is the block kissing rule ): [ R_228 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_228, 228); ! phrase 1 ! [1: stop the action with library message kissing action number 1 for the noun] return GL__M(##Kiss,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_228, 228, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Answering it that (B215_report_answering_it_tha) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor answering something that ( this is the block answering rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor answering something that ( this is the block answering rule ): [ R_229 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_229, 229); ! phrase 1 ! [1: stop the action with library message answering it that action number 1 for the noun] return GL__M(##Answer,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_229, 229, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Telling it about (B216_check_telling_it_about) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor telling something about ( this is the telling yourself rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor telling something about ( this is the telling yourself rule ): [ R_230 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_230, 230); ! phrase 1 ! [1: if the actor is the noun , stop the action with library message telling it about action number 1 for the noun] if (((actor == noun))) { return GL__M(##Tell,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_230, 230, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Telling it about (B218_report_telling_it_about) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor telling something about ( this is the block telling rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor telling something about ( this is the block telling rule ): [ R_231 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_231, 231); ! phrase 1 ! [1: stop the action with library message telling it about action number 2 for the noun] return GL__M(##Tell,2,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_231, 231, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Asking it about (B221_report_asking_it_about) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor asking something about ( this is the block asking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor asking something about ( this is the block asking rule ): [ R_232 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_232, 232); ! phrase 1 ! [1: stop the action with library message asking it about action number 1 for the noun] return GL__M(##Ask,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_232, 232, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Asking it for (B222_check_asking_it_for) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Check an actor asking something for ( this is the asking yourself for something rule ): ! === which is equally specific with === ! Rule 2/2 ! Check an actor asking something for ( this is the translate asking for to giving rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor asking something for ( this is the asking yourself for something rule ): [ R_233 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_233, 233); ! phrase 1 ! [1: if the actor is the noun and the actor is the player , try taking inventory instead] if ((((actor == noun))) && (((actor == player)))) { TryAction(0, player, ##Inv, 0, 0);; rtrue; } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_233, 233, true); rfalse; ]; ! From the Standard Rules ! Check an actor asking something for ( this is the translate asking for to giving rule ): [ R_234 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_234, 234); ! phrase 1 ! [1: convert to request of the noun to perform giving it to action with the second noun and the actor] TryAction(true, noun, ##Give, second, actor); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_234, 234, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Waiting (B226_carry_out_waiting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor waiting: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor waiting: [ R_827 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_827, 827); ! phrase 1 ! [1: increase the initiative modifier of the actor by 2] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)+2); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_827, 827, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Waiting (B227_report_waiting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor waiting ( this is the standard report waiting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor waiting ( this is the standard report waiting rule ): [ R_235 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_235, 235); ! phrase 1 ! [1: if the actor is the player , stop the action with library message waiting action number 1 for the actor] if (((actor == player))) { return GL__M(##Wait,1,actor); } ! phrase 2 ! [2: issue actor-based library message waiting action number 2] AGL__M(##Wait,2,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_235, 235, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Touching (B230_report_touching) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Report an actor touching ( this is the report touching yourself rule ): ! === which is equally specific with === ! Rule 2/3 ! Report an actor touching ( this is the report touching other people rule ): ! === which is equally specific with === ! Rule 3/3 ! Report an actor touching ( this is the report touching things rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor touching ( this is the report touching yourself rule ): [ R_236 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_236, 236); ! phrase 1 ! [1: if the noun is the actor begin] if (((noun == actor))) { ! phrase 2 ! [2: if the actor is the player , issue library message touching action number 3 for the noun] if (((actor == player))) { GL__M(##Touch,3,noun); } ! phrase 3 ! [3: otherwise issue actor-based library message touching action number 4] else { AGL__M(##Touch,4,noun); } ! phrase 4 ! [4: stop the action] rtrue; ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: continue the action] rfalse; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_236, 236, true); rfalse; ]; ! From the Standard Rules ! Report an actor touching ( this is the report touching other people rule ): [ R_237 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_237, 237); ! phrase 1 ! [1: if the noun is a person begin] if (((noun ofclass K8_person))) { ! phrase 2 ! [2: if the actor is the player begin] if (((actor == player))) { ! phrase 3 ! [3: issue library message touching action number 1 for the noun] GL__M(##Touch,1,noun); ! phrase 4 ! [4: otherwise if the noun is the player] } else if (((noun == player))) { ! phrase 5 ! [5: issue actor-based library message touching action number 5] AGL__M(##Touch,5,noun); ! phrase 6 ! [6: otherwise] } else { ! phrase 7 ! [7: issue actor-based library message touching action number 6 for the noun] AGL__M(##Touch,6,noun); ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: stop the action] rtrue; ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: continue the action] rfalse; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_237, 237, true); rfalse; ]; ! From the Standard Rules ! Report an actor touching ( this is the report touching things rule ): [ R_238 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_238, 238); ! phrase 1 ! [1: if the actor is the player , issue library message touching action number 2 for the noun] if (((actor == player))) { GL__M(##Touch,2,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message touching action number 6 for the noun] else { AGL__M(##Touch,6,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_238, 238, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Waving (B231_check_waving) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor waving ( this is the can't wave what's not held rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor waving ( this is the can't wave what's not held rule ): [ R_239 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_239, 239); ! phrase 1 ! [1: if the actor is not the holder of the noun , stop the action with library message waving action number 1 for the noun] if ((~~((actor == (HolderOf(noun)) )))) { return GL__M(##Wave,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_239, 239, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Waving (B233_report_waving) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor waving ( this is the report waving things rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor waving ( this is the report waving things rule ): [ R_240 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_240, 240); ! phrase 1 ! [1: if the actor is the player , issue library message waving action number 2 for the noun] if (((actor == player))) { GL__M(##Wave,2,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message waving action number 3 for the noun] else { AGL__M(##Wave,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_240, 240, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Pulling (B234_check_pulling) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor pulling ( this is the can't pull what's fixed in place rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor pulling ( this is the can't pull scenery rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor pulling ( this is the can't pull people rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor pulling ( this is the can't pull what's fixed in place rule ): [ R_241 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_241, 241); ! phrase 1 ! [1: if the noun is fixed in place , stop the action with library message pulling action number 1 for the noun] if (((Adj_33_t1_v64(noun)))) { return GL__M(##Pull,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_241, 241, true); rfalse; ]; ! From the Standard Rules ! Check an actor pulling ( this is the can't pull scenery rule ): [ R_242 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_242, 242); ! phrase 1 ! [1: if the noun is scenery , stop the action with library message pulling action number 2 for the noun] if (((Adj_35_t1_v64(noun)))) { return GL__M(##Pull,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_242, 242, true); rfalse; ]; ! From the Standard Rules ! Check an actor pulling ( this is the can't pull people rule ): [ R_243 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_243, 243); ! phrase 1 ! [1: if the noun is a person , stop the action with library message pulling action number 4 for the noun] if (((noun ofclass K8_person))) { return GL__M(##Pull,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_243, 243, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Pulling (B236_report_pulling) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor pulling ( this is the report pulling rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor pulling ( this is the report pulling rule ): [ R_244 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_244, 244); ! phrase 1 ! [1: if the actor is the player , issue library message pulling action number 3 for the noun] if (((actor == player))) { GL__M(##Pull,3,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message pulling action number 5 for the noun] else { AGL__M(##Pull,5,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_244, 244, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Pushing (B237_check_pushing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor pushing something ( this is the can't push what's fixed in place rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor pushing something ( this is the can't push scenery rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor pushing something ( this is the can't push people rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor pushing something ( this is the can't push what's fixed in place rule ): [ R_245 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_245, 245); ! phrase 1 ! [1: if the noun is fixed in place , stop the action with library message pushing action number 1 for the noun] if (((Adj_33_t1_v64(noun)))) { return GL__M(##Push,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_245, 245, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something ( this is the can't push scenery rule ): [ R_246 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_246, 246); ! phrase 1 ! [1: if the noun is scenery , stop the action with library message pushing action number 2 for the noun] if (((Adj_35_t1_v64(noun)))) { return GL__M(##Push,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_246, 246, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something ( this is the can't push people rule ): [ R_247 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_247, 247); ! phrase 1 ! [1: if the noun is a person , stop the action with library message pushing action number 4 for the noun] if (((noun ofclass K8_person))) { return GL__M(##Push,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_247, 247, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Pushing (B239_report_pushing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor pushing something ( this is the report pushing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor pushing something ( this is the report pushing rule ): [ R_248 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_248, 248); ! phrase 1 ! [1: if the actor is the player , issue library message pushing action number 3 for the noun] if (((actor == player))) { GL__M(##Push,3,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message pushing action number 6 for the noun] else { AGL__M(##Push,6,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_248, 248, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Turning (B240_check_turning) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! Check an actor turning ( this is the can't turn what's fixed in place rule ): ! === which is equally specific with === ! Rule 2/3 ! Check an actor turning ( this is the can't turn scenery rule ): ! === which is equally specific with === ! Rule 3/3 ! Check an actor turning ( this is the can't turn people rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor turning ( this is the can't turn what's fixed in place rule ): [ R_249 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_249, 249); ! phrase 1 ! [1: if the noun is fixed in place , stop the action with library message turning action number 1 for the noun] if (((Adj_33_t1_v64(noun)))) { return GL__M(##Turn,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_249, 249, true); rfalse; ]; ! From the Standard Rules ! Check an actor turning ( this is the can't turn scenery rule ): [ R_250 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_250, 250); ! phrase 1 ! [1: if the noun is scenery , stop the action with library message turning action number 2 for the noun] if (((Adj_35_t1_v64(noun)))) { return GL__M(##Turn,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_250, 250, true); rfalse; ]; ! From the Standard Rules ! Check an actor turning ( this is the can't turn people rule ): [ R_251 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_251, 251); ! phrase 1 ! [1: if the noun is a person , stop the action with library message turning action number 4 for the noun] if (((noun ofclass K8_person))) { return GL__M(##Turn,4,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_251, 251, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Turning (B242_report_turning) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor turning ( this is the report turning rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor turning ( this is the report turning rule ): [ R_252 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_252, 252); ! phrase 1 ! [1: if the actor is the player , issue library message turning action number 3 for the noun] if (((actor == player))) { GL__M(##Turn,3,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message turning action number 7 for the noun] else { AGL__M(##Turn,7,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_252, 252, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Pushing it to (B243_check_pushing_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/5 ! Check an actor pushing something to ( this is the can't push unpushable things rule ): ! === which is equally specific with === ! Rule 2/5 ! Check an actor pushing something to ( this is the can't push to non-directions rule ): ! === which is equally specific with === ! Rule 3/5 ! Check an actor pushing something to ( this is the can't push vertically rule ): ! === which is equally specific with === ! Rule 4/5 ! Check an actor pushing something to ( this is the standard pushing in directions rule ): ! === which is equally specific with === ! Rule 5/5 ! Check an actor pushing something to ( this is the block pushing in directions rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor pushing something to ( this is the can't push unpushable things rule ): [ R_253 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_253, 253); ! phrase 1 ! [1: if the noun is not pushable between rooms , stop the action with library message pushing it to action number 1 for the noun] if ((~~((Adj_37_t1_v64(noun))))) { return GL__M(##PushDir,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_253, 253, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something to ( this is the can't push to non-directions rule ): [ R_254 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_254, 254); ! phrase 1 ! [1: if the second noun is not a direction , stop the action with library message pushing it to action number 2 for the noun] if ((~~((second ofclass K3_direction)))) { return GL__M(##PushDir,2,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_254, 254, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something to ( this is the can't push vertically rule ): [ R_255 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_255, 255); ! phrase 1 ! [1: if the second noun is up or the second noun is down , stop the action with library message pushing it to action number 3 for the noun] if ((((second == O18_up))) || (((second == O19_down)))) { return GL__M(##PushDir,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_255, 255, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something to ( this is the standard pushing in directions rule ): [ R_256 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_256, 256); ! phrase 1 ! [1: convert to special going-with-push action] ConvertToGoingWithPush(); rtrue; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_256, 256, true); rfalse; ]; ! From the Standard Rules ! Check an actor pushing something to ( this is the block pushing in directions rule ): [ R_257 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_257, 257); ! phrase 1 ! [1: stop the action with library message pushing it to action number 1 for the noun] return GL__M(##PushDir,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_257, 257, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Squeezing (B246_check_squeezing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor squeezing ( this is the innuendo about squeezing people rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor squeezing ( this is the innuendo about squeezing people rule ): [ R_258 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_258, 258); ! phrase 1 ! [1: if the noun is a person , stop the action with library message squeezing action number 1 for the noun] if (((noun ofclass K8_person))) { return GL__M(##Squeeze,1,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_258, 258, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report Squeezing (B248_report_squeezing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report an actor squeezing ( this is the report squeezing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Report an actor squeezing ( this is the report squeezing rule ): [ R_259 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_259, 259); ! phrase 1 ! [1: if the actor is the player , issue library message squeezing action number 2 for the noun] if (((actor == player))) { GL__M(##Squeeze,2,noun); } ! phrase 2 ! [2: otherwise issue actor-based library message squeezing action number 3 for the noun] else { AGL__M(##Squeeze,3,noun); } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_259, 259, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Saying yes (B249_check_saying_yes) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor saying yes ( this is the block saying yes rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor saying yes ( this is the block saying yes rule ): [ R_260 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_260, 260); ! phrase 1 ! [1: stop the action with library message saying yes action number 1] return GL__M(##Yes,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_260, 260, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Saying no (B252_check_saying_no) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor saying no ( this is the block saying no rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor saying no ( this is the block saying no rule ): [ R_261 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_261, 261); ! phrase 1 ! [1: stop the action with library message saying no action number 1] return GL__M(##No,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_261, 261, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Burning (B255_check_burning) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor burning ( this is the block burning rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor burning ( this is the block burning rule ): [ R_262 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_262, 262); ! phrase 1 ! [1: stop the action with library message burning action number 1] return GL__M(##Burn,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_262, 262, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Waking up (B258_check_waking_up) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor waking up ( this is the block waking up rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor waking up ( this is the block waking up rule ): [ R_263 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_263, 263); ! phrase 1 ! [1: stop the action with library message waking up action number 1] return GL__M(##Wake,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_263, 263, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Thinking (B261_check_thinking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor thinking ( this is the block thinking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor thinking ( this is the block thinking rule ): [ R_264 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_264, 264); ! phrase 1 ! [1: stop the action with library message thinking action number 1] return GL__M(##Think,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_264, 264, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Smelling (B264_check_smelling) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor smelling ( this is the block smelling rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor smelling ( this is the block smelling rule ): [ R_265 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_265, 265); ! phrase 1 ! [1: stop the action with library message smelling action number 1 for the noun] return GL__M(##Smell,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_265, 265, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Listening to (B267_check_listening_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor listening ( this is the block listening rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor listening ( this is the block listening rule ): [ R_266 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_266, 266); ! phrase 1 ! [1: stop the action with library message listening to action number 1 for the noun] return GL__M(##Listen,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_266, 266, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Tasting (B270_check_tasting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor tasting ( this is the block tasting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor tasting ( this is the block tasting rule ): [ R_267 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_267, 267); ! phrase 1 ! [1: stop the action with library message tasting action number 1 for the noun] return GL__M(##Taste,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_267, 267, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Cutting (B273_check_cutting) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor cutting ( this is the block cutting rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor cutting ( this is the block cutting rule ): [ R_268 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_268, 268); ! phrase 1 ! [1: stop the action with library message cutting action number 1 for the noun] return GL__M(##Cut,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_268, 268, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Jumping (B276_check_jumping) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor jumping ( this is the block jumping rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor jumping ( this is the block jumping rule ): [ R_269 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_269, 269); ! phrase 1 ! [1: stop the action with library message jumping action number 1] return GL__M(##Jump,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_269, 269, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Tying it to (B279_check_tying_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor tying something to ( this is the block tying rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor tying something to ( this is the block tying rule ): [ R_270 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_270, 270); ! phrase 1 ! [1: stop the action with library message tying it to action number 1 for the noun] return GL__M(##Tie,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_270, 270, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Drinking (B282_check_drinking) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor drinking ( this is the block drinking rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor drinking ( this is the block drinking rule ): [ R_271 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_271, 271); ! phrase 1 ! [1: stop the action with library message drinking action number 1 for the noun] return GL__M(##Drink,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_271, 271, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Saying sorry (B285_check_saying_sorry) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor saying sorry ( this is the block saying sorry rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor saying sorry ( this is the block saying sorry rule ): [ R_272 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_272, 272); ! phrase 1 ! [1: stop the action with library message saying sorry action number 1] return GL__M(##Sorry,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_272, 272, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Swearing obscenely (B288_check_swearing_obscenel) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor swearing obscenely ( this is the block swearing obscenely rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor swearing obscenely ( this is the block swearing obscenely rule ): [ R_273 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_273, 273); ! phrase 1 ! [1: stop the action with library message swearing obscenely action number 1] return GL__M(##Strong,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_273, 273, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Swearing mildly (B291_check_swearing_mildly) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor swearing mildly ( this is the block swearing mildly rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor swearing mildly ( this is the block swearing mildly rule ): [ R_274 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_274, 274); ! phrase 1 ! [1: stop the action with library message swearing mildly action number 1] return GL__M(##Mild,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_274, 274, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Swinging (B294_check_swinging) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor swinging ( this is the block swinging rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor swinging ( this is the block swinging rule ): [ R_275 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_275, 275); ! phrase 1 ! [1: stop the action with library message swinging action number 1 for the noun] return GL__M(##Swing,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_275, 275, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Rubbing (B297_check_rubbing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor rubbing ( this is the block rubbing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor rubbing ( this is the block rubbing rule ): [ R_276 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_276, 276); ! phrase 1 ! [1: stop the action with library message rubbing action number 1 for the noun] return GL__M(##Rub,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_276, 276, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Setting it to (B300_check_setting_it_to) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor setting something to ( this is the block setting it to rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor setting something to ( this is the block setting it to rule ): [ R_277 ; if ((act_requester==nothing) && ((noun ofclass K2_thing))) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_277, 277); ! phrase 1 ! [1: stop the action with library message setting it to action number 1 for the noun] return GL__M(##SetTo,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_277, 277, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Waving hands (B303_check_waving_hands) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor waving hands ( this is the block waving hands rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor waving hands ( this is the block waving hands rule ): [ R_278 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_278, 278); ! phrase 1 ! [1: stop the action with library message waving hands action number 1] return GL__M(##WaveHands,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_278, 278, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Buying (B306_check_buying) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor buying ( this is the block buying rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor buying ( this is the block buying rule ): [ R_279 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_279, 279); ! phrase 1 ! [1: stop the action with library message buying action number 1 for the noun] return GL__M(##Buy,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_279, 279, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Singing (B309_check_singing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor singing ( this is the block singing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor singing ( this is the block singing rule ): [ R_280 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_280, 280); ! phrase 1 ! [1: stop the action with library message singing action number 1] return GL__M(##Sing,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_280, 280, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Climbing (B312_check_climbing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor climbing ( this is the block climbing rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor climbing ( this is the block climbing rule ): [ R_281 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_281, 281); ! phrase 1 ! [1: stop the action with library message climbing action number 1 for the noun] return GL__M(##Climb,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_281, 281, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Sleeping (B315_check_sleeping) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check an actor sleeping ( this is the block sleeping rule ): ! ---------------------------------------------------------------------------------------------------- ! From the Standard Rules ! Check an actor sleeping ( this is the block sleeping rule ): [ R_282 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_282, 282); ! phrase 1 ! [1: stop the action with library message sleeping action number 1] return GL__M(##Sleep,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_282, 282, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Finding responses to (B364_carry_out_finding_respo) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out finding responses to: ! ---------------------------------------------------------------------------------------------------- ! From "Simple Chat" by Mark Tilford ! Carry out finding responses to: [ R_708 ; if (actor == player) { if (debug_rules) DB_Rule(R_708, 708); ! phrase 1 ! [1: do nothing] ; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_708, 708, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Giving text for (B367_carry_out_giving_text_f) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out giving text for: ! ---------------------------------------------------------------------------------------------------- ! From "Simple Chat" by Mark Tilford ! Carry out giving text for: [ R_714 ; if (actor == player) { if (debug_rules) DB_Rule(R_714, 714); ! phrase 1 ! [1: say ~Error: no text for [chat node understood].~] say__p=1;ParaContent(); print (PrintText) SC_171; ParaContent(); print (T47_chat_node) parsed_number; ParaContent(); print (PrintText) SC_122; new_line; .L_Say231; .L_SayX204; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_714, 714, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Giving link to (B370_carry_out_giving_link_t) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out giving link to: ! ---------------------------------------------------------------------------------------------------- ! From "Simple Chat" by Mark Tilford ! Carry out giving link to: [ R_715 ; if (actor == player) { if (debug_rules) DB_Rule(R_715, 715); ! phrase 1 ! [1: say ~Error: no link text for [chat node understood].~] say__p=1;ParaContent(); print (PrintText) SC_172; ParaContent(); print (T47_chat_node) parsed_number; ParaContent(); print (PrintText) SC_122; new_line; .L_Say232; .L_SayX205; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_715, 715, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Preparing (B373_carry_out_preparing) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out preparing: ! ---------------------------------------------------------------------------------------------------- ! From "Simple Chat" by Mark Tilford ! Carry out preparing: [ R_716 ; if (actor == player) { if (debug_rules) DB_Rule(R_716, 716); ! phrase 1 ! [1: activate first chat node] (PHR_709((Global_Vars-->49))); } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_716, 716, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Switching the numbers off (B376_carry_out_switching_the) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out switching the numbers off: ! ---------------------------------------------------------------------------------------------------- ! Carry out switching the numbers off: [ R_807 ; if (actor == player) { if (debug_rules) DB_Rule(R_807, 807); ! phrase 1 ! [1: now the numbers boolean is false] (Global_Vars-->56) = 0; ! phrase 2 ! [2: say ~You will no longer see combat-related numbers.~] say__p=1;ParaContent(); print (PrintText) SC_173; new_line; .L_Say233; .L_SayX206; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_807, 807, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Switching the numbers on (B379_carry_out_switching_the) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out switching the numbers on: ! ---------------------------------------------------------------------------------------------------- ! Carry out switching the numbers on: [ R_808 ; if (actor == player) { if (debug_rules) DB_Rule(R_808, 808); ! phrase 1 ! [1: now the numbers boolean is true] (Global_Vars-->56) = 1; ! phrase 2 ! [2: say ~You will now see combat-related numbers.~] say__p=1;ParaContent(); print (PrintText) SC_174; new_line; .L_Say234; .L_SayX207; } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_808, 808, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: reset combat variables (B381_reset_combat_variables) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A reset combat variables rule ( this is the standard reset combat variables rule ): ! ---------------------------------------------------------------------------------------------------- ! A reset combat variables rule ( this is the standard reset combat variables rule ): [ R_839 ; ! phrase 1 ! [1: now the damage is 0] (Global_Vars-->69) = 0; ! phrase 2 ! [2: now the final damage is 0] (Global_Vars-->71) = 0; ! phrase 3 ! [3: now the to-hit roll is 0] (Global_Vars-->67) = 0; ! phrase 4 ! [4: now the to-hit modifier is 0] (Global_Vars-->68) = 0; ! phrase 5 ! [5: now the damage modifier is 0] (Global_Vars-->70) = 0; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: basic attack roll (B384_basic_attack_roll) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A basic attack roll rule ( this is the standard attack roll rule ): ! ---------------------------------------------------------------------------------------------------- ! A basic attack roll rule ( this is the standard attack roll rule ): [ R_840 ; ! phrase 1 ! [1: if the numbers boolean is true , say ~[italic type]Rolling ~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); style underline; ParaContent(); print (PrintText) SC_175; .L_Say235; .L_SayX208; } ! phrase 2 ! [2: change the to-hit roll to a random number between 1 and 10] (Global_Vars-->67) = (GenerateRandomNumber(1, 10)) ; ! phrase 3 ! [3: if the numbers boolean is true , say the to-hit roll , ~[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (say__n=(Global_Vars-->67)); ParaContent(); RunParagraphOn(); .L_Say236; .L_SayX209; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: whether attack modifiers apply (B385_whether_attack_modifier) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A whether attack modifiers apply rule ( this is the attack modifiers apply unless something intervenes rule ): ! ---------------------------------------------------------------------------------------------------- ! A whether attack modifiers apply rule ( this is the attack modifiers apply unless something intervenes rule ): [ R_841 ; ! phrase 1 ! [1: rule succeeds] RulebookSucceeds(); rtrue; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: attack modifiers (B386_attack_modifiers) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/5 ! An attack modifiers rule ( this is the melee attack bonus rule ): ! === which is equally specific with === ! Rule 2/5 ! An attack modifiers rule ( this is the concentration attack modifier rule ): ! === which is equally specific with === ! Rule 3/5 ! An attack modifiers rule ( this is the dodging attack bonus rule ): ! === which is equally specific with === ! Rule 4/5 ! An attack modifiers rule ( this is the attack bonus from weapon rule ): ! === which is equally specific with === ! Rule 5/5 ! An attack modifiers rule ( this is the charge attack modifier rule ): ! ---------------------------------------------------------------------------------------------------- ! An attack modifiers rule ( this is the melee attack bonus rule ): [ R_842 ; ! phrase 1 ! [1: if the numbers boolean is true , say ~ + ~ , the melee of the global attacker , ~[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_176; ParaContent(); @push self; print (say__n=ValueProperty(self=(Global_Vars-->63),p13_melee)); @pull self; ParaContent(); RunParagraphOn(); .L_Say237; .L_SayX210; } ! phrase 2 ! [2: increase the to-hit modifier by the melee of the global attacker] (Global_Vars-->68) = (Global_Vars-->68) + ValueProperty((Global_Vars-->63),p13_melee); rfalse; ]; ! An attack modifiers rule ( this is the concentration attack modifier rule ): [ R_862 ; ! phrase 1 ! [1: if the concentration of the global attacker is greater than 0 begin] if (((ValueProperty((Global_Vars-->63),p17_concentration) > 0))) { ! phrase 2 ! [2: if the concentration of the global attacker is 1 , now the first dummy is 2] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 1))) { (Global_Vars-->58) = 2; } ! phrase 3 ! [3: if the concentration of the global attacker is 2 , now the first dummy is 4] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 2))) { (Global_Vars-->58) = 4; } ! phrase 4 ! [4: if the concentration of the global attacker is 3 , now the first dummy is 8] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 3))) { (Global_Vars-->58) = 8; } ! phrase 5 ! [5: if the numbers boolean is true , say ~ + ~ , the first dummy , ~ (concentration)[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_176; ParaContent(); print (say__n=(Global_Vars-->58)); ParaContent(); print (PrintText) SC_177; ParaContent(); RunParagraphOn(); .L_Say238; .L_SayX211; } ! phrase 6 ! [6: increase the to-hit modifier by the first dummy] (Global_Vars-->68) = (Global_Vars-->68) + (Global_Vars-->58); ! phrase 7 ! [7: end if] } rfalse; ]; ! An attack modifiers rule ( this is the dodging attack bonus rule ): [ R_875 ; ! phrase 1 ! [1: if the global attacker is at dodge begin] if (((Adj_85_t1_v64((Global_Vars-->63))))) { ! phrase 2 ! [2: if the numbers boolean is true , say ~ + 1 (dodge bonus)[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_178; ParaContent(); RunParagraphOn(); .L_Say239; .L_SayX212; } ! phrase 3 ! [3: increase the to-hit modifier by 1] (Global_Vars-->68) = (Global_Vars-->68) + 1; ! phrase 4 ! [4: end if] } rfalse; ]; ! An attack modifiers rule ( this is the attack bonus from weapon rule ): [ R_922 t_0 ! Local variable e.g. 'item' = OBJECT_TY t_1 ! Local variable e.g. 'n' = NUMBER_TY ; ! phrase 1 ! [1: let item be a random readied weapon enclosed by the global attacker] t_0 = (Prop_34()) ; ! phrase 2 ! [2: let n be the weapon attack bonus of item] t_1 = ValueProperty(t_0,p22_weapon_attack_bonus); ! phrase 3 ! [3: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 4 ! [4: if n is greater than 0 , say ~ + ~ , n , ~ ([item] bonus)[run paragraph on]~] if (((t_1 > 0))) { say__p=1;ParaContent(); print (PrintText) SC_176; ParaContent(); print (say__n=t_1); ParaContent(); print (PrintText) SC_143; ParaContent(); print (name) t_0; ParaContent(); print (PrintText) SC_179; ParaContent(); RunParagraphOn(); .L_Say240; .L_SayX213; } ! phrase 5 ! [5: if n is less than 0 , say ~ - ~ , n , ~ ([item] penalty)[run paragraph on]~] if (((t_1 < 0))) { say__p=1;ParaContent(); print (PrintText) SC_180; ParaContent(); print (say__n=t_1); ParaContent(); print (PrintText) SC_143; ParaContent(); print (name) t_0; ParaContent(); print (PrintText) SC_181; ParaContent(); RunParagraphOn(); .L_Say241; .L_SayX214; } ! phrase 6 ! [6: end if] } ! phrase 7 ! [7: increase the to-hit modifier by n] (Global_Vars-->68) = (Global_Vars-->68) + t_1; rfalse; ]; ! An attack modifiers rule ( this is the charge attack modifier rule ): [ R_970 ; ! phrase 1 ! [1: if the charge boolean is true begin] if ((((Global_Vars-->79) == 1))) { ! phrase 2 ! [2: say ~ + 2 (charging)[run paragraph on]~] say__p=1;ParaContent(); print (PrintText) SC_182; ParaContent(); RunParagraphOn(); .L_Say242; .L_SayX215; ! phrase 3 ! [3: increase the to-hit modifier by 2] (Global_Vars-->68) = (Global_Vars-->68) + 2; ! phrase 4 ! [4: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: always-present attack modifiers (B387_always_present_attack_m) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! An always-present attack modifiers rule ( this is the defensive move bonus rule ): ! === which is equally specific with === ! Rule 2/3 ! An always-present attack modifiers rule ( this is the parry decreases to-hit rule ): ! === which is equally specific with === ! Rule 3/3 ! An always-present attack modifiers rule ( this is the dodging defence bonus rule ): ! ---------------------------------------------------------------------------------------------------- ! An always-present attack modifiers rule ( this is the defensive move bonus rule ): [ R_828 ; ! phrase 1 ! [1: if the react state of the global defender is defensive begin] if (((ValueProperty((Global_Vars-->64),p77_react_state) == Q79_defensive))) { ! phrase 2 ! [2: if the numbers boolean is true , say ~ - 1 (defensive move)[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_183; ParaContent(); RunParagraphOn(); .L_Say243; .L_SayX216; } ! phrase 3 ! [3: decrease the to-hit modifier by 1] (Global_Vars-->68) = (Global_Vars-->68) - 1; ! phrase 4 ! [4: now the react state of the global defender is no react] WriteValueProperty((Global_Vars-->64),p77_react_state,Q78_no_react); ! phrase 5 ! [5: end if] } rfalse; ]; ! An always-present attack modifiers rule ( this is the parry decreases to-hit rule ): [ R_870 t_0 ! Local variable e.g. 'n' = NUMBER_TY ; ! phrase 1 ! [1: if the global defender is at parry begin] if (((Adj_83_t1_v64((Global_Vars-->64))))) { ! phrase 2 ! [2: let n be the passive parry max of global attacker weapon] t_0 = ValueProperty((Global_Vars-->65),p20_passive_parry_max); ! phrase 3 ! [3: if the active parry max of global defender weapon is less than n , now n is the active parry max of global defender weapon] if (((ValueProperty((Global_Vars-->66),p21_active_parry_max) < t_0))) { t_0 = ValueProperty((Global_Vars-->66),p21_active_parry_max); } ! phrase 4 ! [4: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 5 ! [5: if n is greater than 0 , say ~ - ~ , n , ~ (defender parrying)[run paragraph on]~] if (((t_0 > 0))) { say__p=1;ParaContent(); print (PrintText) SC_180; ParaContent(); print (say__n=t_0); ParaContent(); print (PrintText) SC_184; ParaContent(); RunParagraphOn(); .L_Say244; .L_SayX217; } ! phrase 6 ! [6: if n is 0 and active parry max of global defender weapon is 0 begin] if ((((t_0 == 0))) && (((ValueProperty((Global_Vars-->66),p21_active_parry_max) == 0)))) { ! phrase 7 ! [7: say ~ - 0 (cannot parry with [global defender weapon])[run paragraph on]~] say__p=1;ParaContent(); print (PrintText) SC_185; ParaContent(); print (name) (Global_Vars-->66); ParaContent(); print (PrintText) SC_17; ParaContent(); RunParagraphOn(); .L_Say245; .L_SayX218; ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: if n is 0 , say ~ - 0 (cannot parry against [global attacker weapon])[run paragraph on]~] if (((t_0 == 0))) { say__p=1;ParaContent(); print (PrintText) SC_186; ParaContent(); print (name) (Global_Vars-->65); ParaContent(); print (PrintText) SC_17; ParaContent(); RunParagraphOn(); .L_Say246; .L_SayX219; } ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: end if] } ! phrase 12 ! [12: decrease the to-hit modifier by n] (Global_Vars-->68) = (Global_Vars-->68) - t_0; ! phrase 13 ! [13: end if] } rfalse; ]; ! An always-present attack modifiers rule ( this is the dodging defence bonus rule ): [ R_874 t_0 ! Local variable e.g. 'n' = NUMBER_TY ; ! phrase 1 ! [1: if the global defender is at dodge begin] if (((Adj_85_t1_v64((Global_Vars-->64))))) { ! phrase 2 ! [2: let n be the dodgability of global attacker weapon] t_0 = ValueProperty((Global_Vars-->65),p19_dodgability); ! phrase 3 ! [3: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 4 ! [4: if n is greater than 0 , say ~ - ~ , n , ~ (defender dodging)[run paragraph on]~] if (((t_0 > 0))) { say__p=1;ParaContent(); print (PrintText) SC_180; ParaContent(); print (say__n=t_0); ParaContent(); print (PrintText) SC_187; ParaContent(); RunParagraphOn(); .L_Say247; .L_SayX220; } ! phrase 5 ! [5: if n is 0 , say ~ - 0 (cannot dodge)[run paragraph on]~] if (((t_0 == 0))) { say__p=1;ParaContent(); print (PrintText) SC_188; ParaContent(); RunParagraphOn(); .L_Say248; .L_SayX221; } ! phrase 6 ! [6: end if] } ! phrase 7 ! [7: decrease the to-hit modifier by n] (Global_Vars-->68) = (Global_Vars-->68) - t_0; ! phrase 8 ! [8: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: show results of the attack roll (B388_show_results_of_the_att) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A show results of the attack roll rule ( this is the standard result of the attack roll rule ): ! ---------------------------------------------------------------------------------------------------- ! A show results of the attack roll rule ( this is the standard result of the attack roll rule ): [ R_843 ; ! phrase 1 ! [1: increase the to-hit roll by the to-hit modifier] (Global_Vars-->67) = (Global_Vars-->67) + (Global_Vars-->68); ! phrase 2 ! [2: if the numbers boolean is true , say ~ = ~ , the to-hit roll , ~, [run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_189; ParaContent(); print (say__n=(Global_Vars-->67)); ParaContent(); print (PrintText) SC_81; ParaContent(); RunParagraphOn(); .L_Say249; .L_SayX222; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: whether the attack hit (B389_whether_the_attack_hit) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A whether the attack hit rule ( this is the standard whether the attack hit rule ): ! ---------------------------------------------------------------------------------------------------- ! A whether the attack hit rule ( this is the standard whether the attack hit rule ): [ R_844 ; ! phrase 1 ! [1: if the to-hit roll is greater than the defence of the global defender begin] if ((((Global_Vars-->67) > ValueProperty((Global_Vars-->64),p14_defence)))) { ! phrase 2 ! [2: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 3 ! [3: if the global attacker is the player , say ~you beat ~] if ((((Global_Vars-->63) == player))) { say__p=1;ParaContent(); print (PrintText) SC_190; .L_Say250; .L_SayX223; } ! phrase 4 ! [4: otherwise say ~[the global attacker] beats ~] else { say__p=1;ParaContent(); print (the) (Global_Vars-->63); ParaContent(); print (PrintText) SC_191; .L_Say251; .L_SayX224; } ! phrase 5 ! [5: say ~[possessive of global defender] defence rating of ~ , the defence of the global defender , ~.~] say__p=1;ParaContent(); (PHR_791((Global_Vars-->64)));ParaContent(); print (PrintText) SC_192; ParaContent(); @push self; print (say__n=ValueProperty(self=(Global_Vars-->64),p14_defence)); @pull self; ParaContent(); print (PrintText) SC_122; new_line; .L_Say252; .L_SayX225; ! phrase 6 ! [6: end if] } ! phrase 7 ! [7: rule succeeds] RulebookSucceeds(); rtrue; ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 10 ! [10: if the global attacker is the player , say ~you do ~] if ((((Global_Vars-->63) == player))) { say__p=1;ParaContent(); print (PrintText) SC_193; .L_Say253; .L_SayX226; } ! phrase 11 ! [11: if the global attacker is not the player , say ~[the global attacker] does ~] if ((~~(((Global_Vars-->63) == player)))) { say__p=1;ParaContent(); print (the) (Global_Vars-->63); ParaContent(); print (PrintText) SC_194; .L_Say254; .L_SayX227; } ! phrase 12 ! [12: say ~not overcome [possessive of global defender] defence rating of ~ , the defence of the global defender , ~.[run paragraph on]~] say__p=1;ParaContent(); print (PrintText) SC_195; ParaContent(); (PHR_791((Global_Vars-->64)));ParaContent(); print (PrintText) SC_192; ParaContent(); @push self; print (say__n=ValueProperty(self=(Global_Vars-->64),p14_defence)); @pull self; ParaContent(); print (PrintText) SC_122; ParaContent(); RunParagraphOn(); .L_Say255; .L_SayX228; ! phrase 13 ! [13: end if] } ! phrase 14 ! [14: rule fails] RulebookFails(); rtrue; ! phrase 15 ! [15: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: basic damage roll (B391_basic_damage_roll) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! First basic damage roll rule ( this is the standard damage roll rule ): ! ---------------------------------------------------------------------------------------------------- ! First basic damage roll rule ( this is the standard damage roll rule ): [ R_845 ; ! phrase 1 ! [1: now the damage is a random number between 1 and the damage die of the global attacker weapon] (Global_Vars-->69) = (GenerateRandomNumber(1, ValueProperty((Global_Vars-->65),p15_damage_die))) ; ! phrase 2 ! [2: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 3 ! [3: if the global attacker is the player , say ~You deal ~ , damage , ~[run paragraph on]~] if ((((Global_Vars-->63) == player))) { say__p=1;ParaContent(); print (PrintText) SC_196; ParaContent(); print (say__n=(Global_Vars-->69)); ParaContent(); RunParagraphOn(); .L_Say256; .L_SayX229; } ! phrase 4 ! [4: if the global attacker is not the player , say ~[The global attacker] deals ~ , damage , ~[run paragraph on]~] if ((~~(((Global_Vars-->63) == player)))) { say__p=1;ParaContent(); print (The) (Global_Vars-->63); ParaContent(); print (PrintText) SC_197; ParaContent(); print (say__n=(Global_Vars-->69)); ParaContent(); RunParagraphOn(); .L_Say257; .L_SayX230; } ! phrase 5 ! [5: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: damage modifiers (B392_damage_modifiers) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! A damage modifiers rule ( this is the counterattack extra damage rule ): ! === which is equally specific with === ! Rule 2/3 ! A damage modifiers rule ( this is the concentration damage modifier rule ): ! === which is equally specific with === ! Rule 3/3 ! A damage modifiers rule ( this is the charge damage modifier rule ): ! ---------------------------------------------------------------------------------------------------- ! A damage modifiers rule ( this is the counterattack extra damage rule ): [ R_829 ; ! phrase 1 ! [1: if the react state of the global attacker is aggressive or the react state of the global defender is aggressive begin] if ((((ValueProperty((Global_Vars-->63),p77_react_state) == Q80_aggressive))) || (((ValueProperty((Global_Vars-->64),p77_react_state) == Q80_aggressive)))) { ! phrase 2 ! [2: if the numbers boolean is true , say ~ + 3 (both attacking)[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_198; ParaContent(); RunParagraphOn(); .L_Say258; .L_SayX231; } ! phrase 3 ! [3: increase the damage modifier by 3] (Global_Vars-->70) = (Global_Vars-->70) + 3; ! phrase 4 ! [4: now the react state of the global attacker is no react] WriteValueProperty((Global_Vars-->63),p77_react_state,Q78_no_react); ! phrase 5 ! [5: now the react state of the global defender is no react] WriteValueProperty((Global_Vars-->64),p77_react_state,Q78_no_react); ! phrase 6 ! [6: end if] } rfalse; ]; ! A damage modifiers rule ( this is the concentration damage modifier rule ): [ R_863 ; ! phrase 1 ! [1: if the concentration of the global attacker is greater than 1 begin] if (((ValueProperty((Global_Vars-->63),p17_concentration) > 1))) { ! phrase 2 ! [2: if the concentration of the global attacker is 2 , now the first dummy is 2] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 2))) { (Global_Vars-->58) = 2; } ! phrase 3 ! [3: if the concentration of the global attacker is 3 , now the first dummy is 4] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 3))) { (Global_Vars-->58) = 4; } ! phrase 4 ! [4: if the numbers boolean is true , say ~ + ~ , the first dummy , ~ (concentration)[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_176; ParaContent(); print (say__n=(Global_Vars-->58)); ParaContent(); print (PrintText) SC_177; ParaContent(); RunParagraphOn(); .L_Say259; .L_SayX232; } ! phrase 5 ! [5: increase the damage modifier by the first dummy] (Global_Vars-->70) = (Global_Vars-->70) + (Global_Vars-->58); ! phrase 6 ! [6: end if] } rfalse; ]; ! A damage modifiers rule ( this is the charge damage modifier rule ): [ R_971 ; ! phrase 1 ! [1: if the charge boolean is true begin] if ((((Global_Vars-->79) == 1))) { ! phrase 2 ! [2: say ~ + 4 (charging)[run paragraph on]~] say__p=1;ParaContent(); print (PrintText) SC_199; ParaContent(); RunParagraphOn(); .L_Say260; .L_SayX233; ! phrase 3 ! [3: increase the damage modifier by 4] (Global_Vars-->70) = (Global_Vars-->70) + 4; ! phrase 4 ! [4: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: printing-the-damage (B393_printing_the_damage) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Printing-the-damage rule ( this is the standard printing-the-damage rule ): ! ---------------------------------------------------------------------------------------------------- ! Printing-the-damage rule ( this is the standard printing-the-damage rule ): [ R_847 ; ! phrase 1 ! [1: if the numbers boolean is true , say ~ = [bold type]~ , final damage , ~ damage[roman type][italic type], [run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_189; ParaContent(); style bold; ParaContent(); print (say__n=(Global_Vars-->71)); ParaContent(); print (PrintText) SC_200; ParaContent(); style roman; ParaContent(); style underline; ParaContent(); print (PrintText) SC_81; ParaContent(); RunParagraphOn(); .L_Say261; .L_SayX234; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: final damage (B394_final_damage) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Final damage rule ( this is the basic final damage rule ): ! ---------------------------------------------------------------------------------------------------- ! Final damage rule ( this is the basic final damage rule ): [ R_846 ; ! phrase 1 ! [1: now the final damage is the damage plus the damage modifier] (Global_Vars-->71) = ((Global_Vars-->69)+(Global_Vars-->70)) ; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: report no final damage (B395_report_no_final_damage) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Report no final damage rule ( this is the basic no final damage rule ): ! ---------------------------------------------------------------------------------------------------- ! Report no final damage rule ( this is the basic no final damage rule ): [ R_848 ; ! phrase 1 ! [1: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 2 ! [2: if the global defender is not the player , say ~allowing [the global defender] to escape unscathed.[run paragraph on]~] if ((~~(((Global_Vars-->64) == player)))) { say__p=1;ParaContent(); print (PrintText) SC_201; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_202; ParaContent(); RunParagraphOn(); .L_Say262; .L_SayX235; } ! phrase 3 ! [3: if the global defender is the player , say ~allowing you to escape unscathed.[run paragraph on]~] if ((((Global_Vars-->64) == player))) { say__p=1;ParaContent(); print (PrintText) SC_203; ParaContent(); RunParagraphOn(); .L_Say263; .L_SayX236; } ! phrase 4 ! [4: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: non-fatal damage (B396_non_fatal_damage) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! Non-fatal damage rule ( this is the basic non-fatal damage rule ): ! === which is equally specific with === ! Rule 2/2 ! A non-fatal damage rule ( this is the lose concentration when hit rule ): ! ---------------------------------------------------------------------------------------------------- ! Non-fatal damage rule ( this is the basic non-fatal damage rule ): [ R_852 ; ! phrase 1 ! [1: decrease the health of the global defender by the final damage] WriteValueProperty((Global_Vars-->64),p10_health,ValueProperty((Global_Vars-->64),p10_health)-(Global_Vars-->71)); ! phrase 2 ! [2: if the numbers boolean is true begin] if ((((Global_Vars-->56) == 1))) { ! phrase 3 ! [3: if the global defender is not the player , say ~wounding [the global defender] to ~ , health of the global defender , ~ health.[run paragraph on]~] if ((~~(((Global_Vars-->64) == player)))) { say__p=1;ParaContent(); print (PrintText) SC_204; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_205; ParaContent(); @push self; print (say__n=ValueProperty(self=(Global_Vars-->64),p10_health)); @pull self; ParaContent(); print (PrintText) SC_206; ParaContent(); RunParagraphOn(); .L_Say264; .L_SayX237; } ! phrase 4 ! [4: if the global defender is the player , say ~wounding you to ~ , health of the global defender , ~ health.[run paragraph on]~] if ((((Global_Vars-->64) == player))) { say__p=1;ParaContent(); print (PrintText) SC_207; ParaContent(); @push self; print (say__n=ValueProperty(self=(Global_Vars-->64),p10_health)); @pull self; ParaContent(); print (PrintText) SC_206; ParaContent(); RunParagraphOn(); .L_Say265; .L_SayX238; } ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: let the global defender lose concentration] (PHR_866((Global_Vars-->64))); rfalse; ]; ! A non-fatal damage rule ( this is the lose concentration when hit rule ): [ R_864 ; ! phrase 1 ! [1: let the global defender lose concentration] (PHR_866((Global_Vars-->64))); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: fatal damage (B397_fatal_damage) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Fatal damage rule ( this is the basic fatal damage rule ): ! ---------------------------------------------------------------------------------------------------- ! Fatal damage rule ( this is the basic fatal damage rule ): [ R_853 ; ! phrase 1 ! [1: decrease the health of the global defender by the final damage] WriteValueProperty((Global_Vars-->64),p10_health,ValueProperty((Global_Vars-->64),p10_health)-(Global_Vars-->71)); ! phrase 2 ! [2: if the global defender is not the player begin] if ((~~(((Global_Vars-->64) == player)))) { ! phrase 3 ! [3: if the numbers boolean is true , say ~killing [the global defender].[run paragraph on]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_208; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_122; ParaContent(); RunParagraphOn(); .L_Say266; .L_SayX239; } ! phrase 4 ! [4: end if] } ! phrase 5 ! [5: if the global defender is the player begin] if ((((Global_Vars-->64) == player))) { ! phrase 6 ! [6: if the numbers boolean is true , say ~killing you.~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); print (PrintText) SC_209; new_line; .L_Say267; .L_SayX240; } ! phrase 7 ! [7: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: take away until attack bonuses (B398_take_away_until_attack_) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/3 ! A take away until attack bonuses rule ( this is the lose concentration after attacking rule ): ! === which is equally specific with === ! Rule 2/3 ! A take away until attack bonuses rule ( this is the no longer at parry after attacking rule ): ! === which is equally specific with === ! Rule 3/3 ! A take away until attack bonuses rule ( this is the no longer at dodge after attacking rule ): ! ---------------------------------------------------------------------------------------------------- ! A take away until attack bonuses rule ( this is the lose concentration after attacking rule ): [ R_865 ; ! phrase 1 ! [1: now the concentration of the global attacker is 0] WriteValueProperty((Global_Vars-->63),p17_concentration,0); rfalse; ]; ! A take away until attack bonuses rule ( this is the no longer at parry after attacking rule ): [ R_871 ; ! phrase 1 ! [1: now the global attacker is not at parry] Adj_83_t3_v64((Global_Vars-->63)); rfalse; ]; ! A take away until attack bonuses rule ( this is the no longer at dodge after attacking rule ): [ R_876 ; ! phrase 1 ! [1: now the global attacker is not at dodge] Adj_85_t3_v64((Global_Vars-->63)); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: print flavour text (B399_print_flavour_text) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! First print flavour text rule: ! --- now the mid-placed rules --- ! Rule 2/2 ! A print flavour text rule: ! ---------------------------------------------------------------------------------------------------- ! First print flavour text rule: [ R_849 ; ! phrase 1 ! [1: if the numbers boolean is true , say ~[roman type][paragraph break]~] if ((((Global_Vars-->56) == 1))) { say__p=1;ParaContent(); style roman; ParaContent(); DivideParagraphPoint(); new_line; .L_Say268; .L_SayX241; } rfalse; ]; ! A print flavour text rule: [ R_931 ; ! phrase 1 ! [1: abide by the intervening flavour text rules] if (ProcessRulebook(419)) rtrue; ! phrase 2 ! [2: if the global defender is alive begin] if (((Adj_20_t1_v64((Global_Vars-->64))))) { ! phrase 3 ! [3: abide by the flavour rulebook] if (ProcessRulebook(420)) rtrue; ! phrase 4 ! [4: otherwise] } else { ! phrase 5 ! [5: if the global defender is the player , abide by the fatal player flavour rulebook] if ((((Global_Vars-->64) == player))) { if (ProcessRulebook(421)) rtrue; } ! phrase 6 ! [6: if the global defender is not the player , abide by the fatal flavour rulebook] if ((~~(((Global_Vars-->64) == player)))) { if (ProcessRulebook(422)) rtrue; } ! phrase 7 ! [7: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: aftereffects (B400_aftereffects) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/2 ! An aftereffects rule ( this is the modify initiative based on combat results rule ): ! === which is equally specific with === ! Rule 2/2 ! An aftereffects rule ( this is the decrease ammo rule ): ! ---------------------------------------------------------------------------------------------------- ! An aftereffects rule ( this is the modify initiative based on combat results rule ): [ R_826 ; ! phrase 1 ! [1: if the final damage is greater than 0 begin] if ((((Global_Vars-->71) > 0))) { ! phrase 2 ! [2: decrease the initiative modifier of the global defender by the final damage] WriteValueProperty((Global_Vars-->64),p16_initiative_modifier,ValueProperty((Global_Vars-->64),p16_initiative_modifier)-(Global_Vars-->71)); ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: decrease the initiative modifier of the global attacker by 2] WriteValueProperty((Global_Vars-->63),p16_initiative_modifier,ValueProperty((Global_Vars-->63),p16_initiative_modifier)-2); ! phrase 5 ! [5: end if] } rfalse; ]; ! An aftereffects rule ( this is the decrease ammo rule ): [ R_938 ; ! phrase 1 ! [1: if the maximum shots of the global attacker weapon is greater than 0 begin] if (((ValueProperty((Global_Vars-->65),p23_maximum_shots) > 0))) { ! phrase 2 ! [2: decrease the current shots of the global attacker weapon by 1] WriteValueProperty((Global_Vars-->65),p24_current_shots,ValueProperty((Global_Vars-->65),p24_current_shots)-1); ! phrase 3 ! [3: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: final blow report (B401_final_blow_report) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Last final blow report rule ( this is the end reporting blow with paragraph break rule ): ! ---------------------------------------------------------------------------------------------------- ! Last final blow report rule ( this is the end reporting blow with paragraph break rule ): [ R_850 ; ! phrase 1 ! [1: say ~[paragraph break]~] say__p=1;ParaContent(); DivideParagraphPoint(); new_line; .L_Say269; .L_SayX242; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Concentrating (B403_carry_out_concentrating) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor concentrating: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor concentrating: [ R_861 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_861, 861); ! phrase 1 ! [1: increase the initiative modifier of the actor by 1] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)+1); ! phrase 2 ! [2: increase the concentration of the actor by 1] WriteValueProperty(actor,p17_concentration,ValueProperty(actor,p17_concentration)+1); ! phrase 3 ! [3: if the concentration of the actor is greater than 3 , now the concentration of the actor is 3] if (((ValueProperty(actor,p17_concentration) > 3))) { WriteValueProperty(actor,p17_concentration,3); } ! phrase 4 ! [4: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 5 ! [5: if the concentration of the actor is 1 , say ~[CAP-actor] concentrate[s], and [is-are] now mildly concentrated.~] if (((ValueProperty(actor,p17_concentration) == 1))) { say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_210; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_211; ParaContent(); (PHR_758());ParaContent(); print (PrintText) SC_212; new_line; .L_Say270; .L_SayX243; } ! phrase 6 ! [6: if the concentration of the actor is 2 , say ~[CAP-actor] concentrate[s], and [is-are] now quite concentrated.~] if (((ValueProperty(actor,p17_concentration) == 2))) { say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_210; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_211; ParaContent(); (PHR_758());ParaContent(); print (PrintText) SC_213; new_line; .L_Say271; .L_SayX244; } ! phrase 7 ! [7: if the concentration of the actor is 3 , say ~[CAP-actor] concentrate[s], and [is-are] now maximally concentrated.~] if (((ValueProperty(actor,p17_concentration) == 3))) { say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_210; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_211; ParaContent(); (PHR_758());ParaContent(); print (PrintText) SC_214; new_line; .L_Say272; .L_SayX245; } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_861, 861, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Parrying (B406_carry_out_parrying) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor parrying: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor parrying: [ R_869 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_869, 869); ! phrase 1 ! [1: increase the initiative modifier of the actor by 1] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)+1); ! phrase 2 ! [2: if the combat state of the actor is react begin] if (((ValueProperty(actor,p76_combat_state) == Q77_react))) { ! phrase 3 ! [3: now the react state of the actor is defensive] WriteValueProperty(actor,p77_react_state,Q79_defensive); ! phrase 4 ! [4: increase the initiative modifier of the actor by 1] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)+1); ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: now the actor is at parry] Adj_83_t2_v64(actor); ! phrase 7 ! [7: now the actor is not at dodge] Adj_85_t3_v64(actor); ! phrase 8 ! [8: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 9 ! [9: say ~[CAP-actor] strike[s] up a defensive pose.~] say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_215; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_216; new_line; .L_Say273; .L_SayX246; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_869, 869, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Dodging (B409_carry_out_dodging) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor dodging: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor dodging: [ R_873 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_873, 873); ! phrase 1 ! [1: increase the initiative modifier of the actor by 1] WriteValueProperty(actor,p16_initiative_modifier,ValueProperty(actor,p16_initiative_modifier)+1); ! phrase 2 ! [2: if the combat state of the actor is react , now the react state of the actor is defensive] if (((ValueProperty(actor,p76_combat_state) == Q77_react))) { WriteValueProperty(actor,p77_react_state,Q79_defensive); } ! phrase 3 ! [3: now the actor is at dodge] Adj_85_t2_v64(actor); ! phrase 4 ! [4: now the actor is not at parry] Adj_83_t3_v64(actor); ! phrase 5 ! [5: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 6 ! [6: say ~[CAP-actor] get[s] ready for quick evasive maneuvers.~] say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_217; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_218; new_line; .L_Say274; .L_SayX247; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_873, 873, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: standard AI target select (B411_standard_ai_target_sele) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/10 ! A standard AI target select rule ( this is the prefer targets you press rule ): ! === which is equally specific with === ! Rule 2/10 ! A standard AI target select rule ( this is the prefer those who press you rule ): ! === which is equally specific with === ! Rule 3/10 ! A standard AI target select rule ( this is the prefer the player rule ): ! === which is equally specific with === ! Rule 4/10 ! A standard AI target select rule ( this is the prefer the severely wounded rule ): ! === which is equally specific with === ! Rule 5/10 ! A standard AI target select rule ( this is the prefer concentrated people rule ): ! === which is equally specific with === ! Rule 6/10 ! A standard AI target select rule ( this is the prefer those with good weapons rule ): ! === which is equally specific with === ! Rule 7/10 ! A standard AI target select rule ( this is the do not prefer dodgers rule ): ! === which is equally specific with === ! Rule 8/10 ! A standard AI target select rule ( this is the do not prefer parrying rule ): ! === which is equally specific with === ! Rule 9/10 ! A standard AI target select rule ( this is the do not prefer high defence unless concentrated rule ): ! === which is equally specific with === ! Rule 10/10 ! A standard AI target select rule ( this is the randomise the target result rule ): ! ---------------------------------------------------------------------------------------------------- ! A standard AI target select rule ( this is the prefer targets you press rule ): [ R_882 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the global attacker presses stored_person , increase the weight entry by 3] if ((((Relation_TestVtoV((Global_Vars-->63),V2V_Bitmap_67,(Global_Vars-->74),false))))) { TableLookUpEntry(ct_0,116,ct_1,2,3); } rfalse; ]; ! A standard AI target select rule ( this is the prefer those who press you rule ): [ R_883 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the stored_person presses the global attacker , increase the weight entry by 1] if ((((Relation_TestVtoV((Global_Vars-->74),V2V_Bitmap_67,(Global_Vars-->63),false))))) { TableLookUpEntry(ct_0,116,ct_1,2,1); } rfalse; ]; ! A standard AI target select rule ( this is the prefer the player rule ): [ R_884 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the stored_person is the player , increase the weight entry by 1] if ((((Global_Vars-->74) == player))) { TableLookUpEntry(ct_0,116,ct_1,2,1); } rfalse; ]; ! A standard AI target select rule ( this is the prefer the severely wounded rule ): [ R_885 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the health of stored_person times 2 is less than the permanent health of stored_person , increase the weight entry by 2] if ((( (ValueProperty((Global_Vars-->74),p10_health)*2) < ValueProperty((Global_Vars-->74),p11_permanent_health)))) { TableLookUpEntry(ct_0,116,ct_1,2,2); } ! phrase 3 ! [3: if the health of stored_person times 4 is less than the permanent health of stored_person , increase the weight entry by 4] if ((( (ValueProperty((Global_Vars-->74),p10_health)*4) < ValueProperty((Global_Vars-->74),p11_permanent_health)))) { TableLookUpEntry(ct_0,116,ct_1,2,4); } rfalse; ]; ! A standard AI target select rule ( this is the prefer concentrated people rule ): [ R_886 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: increase the weight entry by the concentration of the stored_person] TableLookUpEntry(ct_0,116,ct_1,2,ValueProperty((Global_Vars-->74),p17_concentration)); ! phrase 3 ! [3: if the concentration of the stored_person is 3 , increase the weight entry by 2] if (((ValueProperty((Global_Vars-->74),p17_concentration) == 3))) { TableLookUpEntry(ct_0,116,ct_1,2,2); } rfalse; ]; ! A standard AI target select rule ( this is the prefer those with good weapons rule ): [ R_887 t_0 ! Local variable e.g. 'item' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let item be a random readied weapon enclosed by the stored_person] t_0 = (Prop_35()) ; ! phrase 3 ! [3: increase the weight entry by the damage die of item] TableLookUpEntry(ct_0,116,ct_1,2,ValueProperty(t_0,p15_damage_die)); rfalse; ]; ! A standard AI target select rule ( this is the do not prefer dodgers rule ): [ R_888 t_0 ! Local variable e.g. 'item' = OBJECT_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let item be a random readied weapon enclosed by the global attacker] t_0 = (Prop_36()) ; ! phrase 3 ! [3: if the stored_person is at dodge , decrease the weight entry by the dodgability of item] if (((Adj_85_t1_v64((Global_Vars-->74))))) { TableLookUpEntry(ct_0,116,ct_1,3,ValueProperty(t_0,p19_dodgability)); } rfalse; ]; ! A standard AI target select rule ( this is the do not prefer parrying rule ): [ R_889 t_0 ! Local variable e.g. 'item' = OBJECT_TY t_1 ! Local variable e.g. 'item2' = OBJECT_TY t_2 ! Local variable e.g. 'n' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let item be a random readied weapon enclosed by the global attacker] t_0 = (Prop_37()) ; ! phrase 3 ! [3: let item2 be a random readied weapon enclosed by the stored_person] t_1 = (Prop_38()) ; ! phrase 4 ! [4: let n be the passive parry max of item] t_2 = ValueProperty(t_0,p20_passive_parry_max); ! phrase 5 ! [5: if the active parry max of item2 is less than n , now n is the active parry max of item2] if (((ValueProperty(t_1,p21_active_parry_max) < t_2))) { t_2 = ValueProperty(t_1,p21_active_parry_max); } ! phrase 6 ! [6: if the stored_person is at parry , decrease the weight entry by n] if (((Adj_83_t1_v64((Global_Vars-->74))))) { TableLookUpEntry(ct_0,116,ct_1,3,t_2); } rfalse; ]; ! A standard AI target select rule ( this is the do not prefer high defence unless concentrated rule ): [ R_890 t_0 ! Local variable e.g. 'n' = NUMBER_TY t_1 ! Local variable e.g. 'm' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let n be the defence of stored_person minus the melee of the global attacker] t_0 = (ValueProperty((Global_Vars-->74),p14_defence)-ValueProperty((Global_Vars-->63),p13_melee)) ; ! phrase 3 ! [3: if n is less than 0 , now n is 0] if (((t_0 < 0))) { t_0 = 0; } ! phrase 4 ! [4: let m be the concentration of the global attacker minus 1] t_1 = (ValueProperty((Global_Vars-->63),p17_concentration)-1) ; ! phrase 5 ! [5: increase the weight entry by n times m] TableLookUpEntry(ct_0,116,ct_1,2, (t_0*t_1) ); rfalse; ]; ! A standard AI target select rule ( this is the randomise the target result rule ): [ R_891 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat person options] ct_0 = T6_ai_combat_person_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: increase the weight entry by a random number between 0 and 3] TableLookUpEntry(ct_0,116,ct_1,2, (GenerateRandomNumber(0, 3)) ); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: standard AI weapon select (B412_standard_ai_weapon_sele) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/11 ! A standard AI weapon select rule ( this is the prefer lots of damage rule ): ! === which is equally specific with === ! Rule 2/11 ! A standard AI weapon select rule ( this is the prefer bad dodgability rule ): ! === which is equally specific with === ! Rule 3/11 ! A standard AI weapon select rule ( this is the prefer bad passive parry rule ): ! === which is equally specific with === ! Rule 4/11 ! A standard AI weapon select rule ( this is the prefer good active parry rule ): ! === which is equally specific with === ! Rule 5/11 ! A standard AI weapon select rule ( this is the prefer balanced parry and dodge rule ): ! === which is equally specific with === ! Rule 6/11 ! A standard AI weapon select rule ( this is the prefer good attack bonus rule ): ! === which is equally specific with === ! Rule 7/11 ! A standard AI weapon select rule ( this is the prefer readied weapon if attacker almost dead rule ): ! === which is equally specific with === ! Rule 8/11 ! A standard AI weapon select rule ( this is the prefer readied weapon if defender almost dead rule ): ! === which is equally specific with === ! Rule 9/11 ! A standard AI weapon select rule ( this is the slightly prefer readied weapon rule ): ! --- now the last-placed rules --- ! Rule 10/11 ! Last standard AI weapon select rule ( this is the do not prefer low ammo and long reload rule ): ! === which is equally specific with === ! Rule 11/11 ! Last standard AI weapon select rule ( this is the do not chose an empty weapon that cannot be reloaded rule ): ! ---------------------------------------------------------------------------------------------------- ! A standard AI weapon select rule ( this is the prefer lots of damage rule ): [ R_893 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: increase the weight entry by the damage die of the weapon option entry] TableLookUpEntry(ct_0,116,ct_1,2,ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p15_damage_die)); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer bad dodgability rule ): [ R_894 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: decrease the weight entry by the dodgability of the weapon option entry] TableLookUpEntry(ct_0,116,ct_1,3,ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p19_dodgability)); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer bad passive parry rule ): [ R_895 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: decrease the weight entry by the passive parry max of the weapon option entry] TableLookUpEntry(ct_0,116,ct_1,3,ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p20_passive_parry_max)); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer good active parry rule ): [ R_896 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: increase the weight entry by the active parry max of the weapon option entry] TableLookUpEntry(ct_0,116,ct_1,2,ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p21_active_parry_max)); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer balanced parry and dodge rule ): [ R_897 t_0 ! Local variable e.g. 'n' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let n be the dodgability of the weapon option entry] t_0 = ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p19_dodgability); ! phrase 3 ! [3: decrease n by the passive parry max of the weapon option entry] t_0 = t_0 - ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p20_passive_parry_max); ! phrase 4 ! [4: if n is less than 0 , now n is 0 minus n] if (((t_0 < 0))) { t_0 = (0-t_0) ; } ! phrase 5 ! [5: now n is n divided by 2] t_0 = (IntegerDivide(t_0,2)) ; ! phrase 6 ! [6: decrease the weight entry by n] TableLookUpEntry(ct_0,116,ct_1,3,t_0); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer good attack bonus rule ): [ R_898 t_0 ! Local variable e.g. 'n' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: let n be the weapon attack bonus of the weapon option entry] t_0 = ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p22_weapon_attack_bonus); ! phrase 3 ! [3: increase the weight entry by n] TableLookUpEntry(ct_0,116,ct_1,2,t_0); rfalse; ]; ! A standard AI weapon select rule ( this is the prefer readied weapon if attacker almost dead rule ): [ R_899 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if four times the health of the global attacker is less than the permanent health of the global attacker begin] if ((( (4*ValueProperty((Global_Vars-->63),p10_health)) < ValueProperty((Global_Vars-->63),p11_permanent_health)))) { ! phrase 3 ! [3: if the weapon option entry is readied , increase the weight entry by 3] if (((Adj_81_t1_v64(TableLookUpEntry(ct_0,118,ct_1))))) { TableLookUpEntry(ct_0,116,ct_1,2,3); } ! phrase 4 ! [4: end if] } rfalse; ]; ! A standard AI weapon select rule ( this is the prefer readied weapon if defender almost dead rule ): [ R_900 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if four times the health of the global defender is less than the permanent health of the global attacker begin] if ((( (4*ValueProperty((Global_Vars-->64),p10_health)) < ValueProperty((Global_Vars-->63),p11_permanent_health)))) { ! phrase 3 ! [3: if the weapon option entry is readied , increase the weight entry by 4] if (((Adj_81_t1_v64(TableLookUpEntry(ct_0,118,ct_1))))) { TableLookUpEntry(ct_0,116,ct_1,2,4); } ! phrase 4 ! [4: end if] } rfalse; ]; ! A standard AI weapon select rule ( this is the slightly prefer readied weapon rule ): [ R_901 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the weapon option entry is readied , increase the weight entry by 1] if (((Adj_81_t1_v64(TableLookUpEntry(ct_0,118,ct_1))))) { TableLookUpEntry(ct_0,116,ct_1,2,1); } rfalse; ]; ! Last standard AI weapon select rule ( this is the do not prefer low ammo and long reload rule ): [ R_944 t_0 ! Local variable e.g. 'n' = NUMBER_TY t_1 ! Local variable e.g. 'm' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the weapon option entry is readied and the current shots of the weapon option entry is greater than 0 begin] if ((((Adj_81_t1_v64(TableLookUpEntry(ct_0,118,ct_1))))) && (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p24_current_shots) > 0)))) { ! phrase 3 ! [3: increase the weight entry by 0] TableLookUpEntry(ct_0,116,ct_1,2,0); ! phrase 4 ! [4: otherwise] } else { ! phrase 5 ! [5: let n be the weight entry] t_0 = TableLookUpEntry(ct_0,116,ct_1); ! phrase 6 ! [6: let m be the maximum shots of the weapon option entry] t_1 = ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p23_maximum_shots); ! phrase 7 ! [7: let m be m + 1] t_1 = (t_1+1) ; ! phrase 8 ! [8: let n be n times m] t_0 = (t_0*t_1) ; ! phrase 9 ! [9: let m be m + the maximum load time of the weapon option entry] t_1 = (t_1+ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p25_maximum_load_time)) ; ! phrase 10 ! [10: if the maximum load time of the weapon option entry is -1 , increase m by 1] if (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p25_maximum_load_time) == -1))) { t_1 = t_1 + 1; } ! phrase 11 ! [11: let n be n divided by m] t_0 = (IntegerDivide(t_0,t_1)) ; ! phrase 12 ! [12: now the weight entry is n] TableLookUpEntry(ct_0,116,ct_1,1,t_0); ! phrase 13 ! [13: if the current shots of the weapon option entry is less than 1 , decrease the weight entry by 1] if (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p24_current_shots) < 1))) { TableLookUpEntry(ct_0,116,ct_1,3,1); } ! phrase 14 ! [14: if the current shots of the weapon option entry is less than 2 , decrease the weight entry by 1] if (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p24_current_shots) < 2))) { TableLookUpEntry(ct_0,116,ct_1,3,1); } ! phrase 15 ! [15: end if] } rfalse; ]; ! Last standard AI weapon select rule ( this is the do not chose an empty weapon that cannot be reloaded rule ): [ R_945 ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row stored_row in table of ai combat weapon options] ct_0 = T8_ai_combat_weapon_options; ct_1 = (Global_Vars-->73); ! phrase 2 ! [2: if the maximum shots of the weapon option entry is 0 begin] if (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p23_maximum_shots) == 0))) { ! phrase 3 ! [3: if the maximum load time of the weapon option entry is -1 , now the weight entry is -100] if (((ValueProperty(TableLookUpEntry(ct_0,118,ct_1),p25_maximum_load_time) == -1))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 4 ! [4: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: standard AI action select (B413_standard_ai_action_sele) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/16 ! First standard AI action select rule ( this is the consider charging rule ): ! === which is equally specific with === ! Rule 2/16 ! First standard AI action select rule ( this is the calculate the chance to win rule ): ! === which is equally specific with === ! Rule 3/16 ! First standard AI action select rule ( this is the consider reloading rule ): ! === which is equally specific with === ! Rule 4/16 ! First standard AI action select rule ( this is the consider readying rule ): ! === which is equally specific with === ! Rule 5/16 ! First standard AI action select rule ( this is the consider parrying rule ): ! === which is equally specific with === ! Rule 6/16 ! First standard AI action select rule ( this is the consider dodging rule ): ! === which is equally specific with === ! Rule 7/16 ! First standard AI action select rule ( this is the consider concentrating rule ): ! === which is equally specific with === ! Rule 8/16 ! First standard AI action select rule ( this is the consider attacking rule ): ! --- now the mid-placed rules --- ! Rule 9/16 ! A standard AI action select rule ( this is the standard attack select rule ): ! === which is equally specific with === ! Rule 10/16 ! A standard AI action select rule ( this is the standard concentration select rule ): ! === which is equally specific with === ! Rule 11/16 ! A standard AI action select rule ( this is the concentration influences attacking rule ): ! === which is equally specific with === ! Rule 12/16 ! A standard AI action select rule ( this is the standard parry and dodge select rule ): ! === which is equally specific with === ! Rule 13/16 ! A standard AI action select rule ( this is the standard ready select rule ): ! === which is equally specific with === ! Rule 14/16 ! A standard AI action select rule ( this is the standard reloading select rule ): ! === which is equally specific with === ! Rule 15/16 ! A standard AI action select rule ( this is the boar charge select rule ): ! --- now the last-placed rules --- ! Rule 16/16 ! Last standard AI action select rule ( this is the randomise the action result rule ): ! ---------------------------------------------------------------------------------------------------- ! First standard AI action select rule ( this is the consider charging rule ): [ R_948 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_7(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_7 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker charging the global defender] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A91_charging, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: change the weight entry to -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); rfalse; ]; ! First standard AI action select rule ( this is the calculate the chance to win rule ): [ R_909 ; ! phrase 1 ! [1: consider the chance to win rules] ProcessRulebook(414); rfalse; ]; ! First standard AI action select rule ( this is the consider reloading rule ): [ R_908 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_8(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_8 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker reloading the stored_weapon] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A90_reloading, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: change the weight entry to 0] TableLookUpEntry(ct_0,116,ct_1,1,0); rfalse; ]; ! First standard AI action select rule ( this is the consider readying rule ): [ R_907 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_9(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_9 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker readying the stored_weapon] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A89_readying, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: change the weight entry to 0] TableLookUpEntry(ct_0,116,ct_1,1,0); rfalse; ]; ! First standard AI action select rule ( this is the consider parrying rule ): [ R_906 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_10(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_10 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker parrying] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A87_parrying, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: if the combat state of the global attacker is not react begin] if ((~~((ValueProperty((Global_Vars-->63),p76_combat_state) == Q77_react)))) { ! phrase 4 ! [4: change the weight entry to 1] TableLookUpEntry(ct_0,116,ct_1,1,1); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: change the weight entry to 5] TableLookUpEntry(ct_0,116,ct_1,1,5); ! phrase 7 ! [7: end if] } rfalse; ]; ! First standard AI action select rule ( this is the consider dodging rule ): [ R_905 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_11(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_11 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker dodging] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A88_dodging, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: if the combat state of the global attacker is not react begin] if ((~~((ValueProperty((Global_Vars-->63),p76_combat_state) == Q77_react)))) { ! phrase 4 ! [4: change the weight entry to 1] TableLookUpEntry(ct_0,116,ct_1,1,1); ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: change the weight entry to 5] TableLookUpEntry(ct_0,116,ct_1,1,5); ! phrase 7 ! [7: end if] } rfalse; ]; ! First standard AI action select rule ( this is the consider concentrating rule ): [ R_904 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_12(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_12 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker concentrating] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##A86_concentrating, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: change the weight entry to 3] TableLookUpEntry(ct_0,116,ct_1,1,3); rfalse; ]; ! First standard AI action select rule ( this is the consider attacking rule ): [ R_903 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_13(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_13 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose a blank row in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableBlankRow(ct_0); ! phrase 2 ! [2: change the option entry to the action of the global attacker attacking the global defender] BlkValueCopy(TableLookUpEntry(ct_0,117,ct_1,5), TryAction(0, (Global_Vars-->63), ##Attack, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+0)))) ); ! phrase 3 ! [3: change the weight entry to 5] TableLookUpEntry(ct_0,116,ct_1,1,5); rfalse; ]; ! A standard AI action select rule ( this is the standard attack select rule ): [ R_914 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_14(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_14 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row with an option of the action of the global attacker attacking the global defender in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##Attack, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 2 ! [2: if the chance-to-win is 0 , change the weight entry to -100] if ((((Global_Vars-->78) == 0))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 3 ! [3: decrease the weight entry by 5] TableLookUpEntry(ct_0,116,ct_1,3,5); ! phrase 4 ! [4: increase the weight entry by the chance-to-win] TableLookUpEntry(ct_0,116,ct_1,2,(Global_Vars-->78)); rfalse; ]; ! A standard AI action select rule ( this is the standard concentration select rule ): [ R_915 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_15(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_15 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row with an option of the action of the global attacker concentrating in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##A86_concentrating, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 2 ! [2: increase the weight entry by 5] TableLookUpEntry(ct_0,116,ct_1,2,5); ! phrase 3 ! [3: decrease the weight entry by the chance-to-win] TableLookUpEntry(ct_0,116,ct_1,3,(Global_Vars-->78)); ! phrase 4 ! [4: if the concentration of the global attacker is 3 , now the weight entry is -100] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 3))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } rfalse; ]; ! A standard AI action select rule ( this is the concentration influences attacking rule ): [ R_916 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_16(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_16 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: choose row with an option of the action of the global attacker attacking the global defender in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##Attack, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 2 ! [2: increase the weight entry by the concentration of the global defender] TableLookUpEntry(ct_0,116,ct_1,2,ValueProperty((Global_Vars-->64),p17_concentration)); ! phrase 3 ! [3: if the concentration of the global defender is 3 , increase the weight entry by 2] if (((ValueProperty((Global_Vars-->64),p17_concentration) == 3))) { TableLookUpEntry(ct_0,116,ct_1,2,2); } rfalse; ]; ! A standard AI action select rule ( this is the standard parry and dodge select rule ): [ R_917 ;blockv_stack-->(blockv_sp+3) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+2) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 4; blockv_stack-->(blockv_sp++) = R_SHELL_17(blockv_sp-4); blockv_sp = blockv_sp - 5; BlkFree(blockv_stack-->(blockv_sp+3)); BlkFree(blockv_stack-->(blockv_sp+2)); BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+4); ]; [ R_SHELL_17 I7BASPL t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_2 ! Local variable e.g. 'd' = NUMBER_TY t_3 ! Local variable e.g. 'p' = NUMBER_TY t_4 ! Local variable e.g. 'item' = OBJECT_TY t_5 ! Local variable e.g. 'm' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat with x running through alive persons enclosed by the location begin] for (t_0=Prop_39(0), t_1=Prop_39(t_0): t_0: t_0=t_1, t_1=Prop_39(t_1)) { if (debug_rules>1) print " [repetition with X set to ", (PrintShortName) t_0, "]^"; ! phrase 2 ! [2: let d be 0] t_2 = 0; ! phrase 3 ! [3: let p be 0] t_3 = 0; ! phrase 4 ! [4: if x presses the global attacker begin] if ((((Relation_TestVtoV(t_0,V2V_Bitmap_67,(Global_Vars-->63),false))))) { ! phrase 5 ! [5: let item be a random readied weapon enclosed by x] t_4 = (Prop_40(,t_0)) ; ! phrase 6 ! [6: increase d by the dodgability of item] t_2 = t_2 + ValueProperty(t_4,p19_dodgability); ! phrase 7 ! [7: let m be the passive parry max of item] t_5 = ValueProperty(t_4,p20_passive_parry_max); ! phrase 8 ! [8: if m is greater than active parry max of stored_weapon , now m is active parry max of stored_weapon] if (((t_5 > ValueProperty((Global_Vars-->75),p21_active_parry_max)))) { t_5 = ValueProperty((Global_Vars-->75),p21_active_parry_max); } ! phrase 9 ! [9: increase p by m] t_3 = t_3 + t_5; ! phrase 10 ! [10: end if] } ! phrase 11 ! [11: choose row with an option of the action of the global attacker dodging in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##A88_dodging, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 12 ! [12: increase the weight entry by d] TableLookUpEntry(ct_0,116,ct_1,2,t_2); ! phrase 13 ! [13: if the global attacker is at parry , decrease the weight entry by 2] if (((Adj_83_t1_v64((Global_Vars-->63))))) { TableLookUpEntry(ct_0,116,ct_1,3,2); } ! phrase 14 ! [14: if d is not greater than p , now the weight entry is -100] if ((~~((t_2 > t_3)))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 15 ! [15: if the global attacker is at dodge and the combat state of the global attacker is not react , now the weight entry is -100] if ((((Adj_85_t1_v64((Global_Vars-->63))))) && ((~~((ValueProperty((Global_Vars-->63),p76_combat_state) == Q77_react))))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 16 ! [16: choose row with an option of the action of the global attacker parrying in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+2)), TryAction(0, (Global_Vars-->63), ##A87_parrying, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+3)))) )); ! phrase 17 ! [17: increase the weight entry by p] TableLookUpEntry(ct_0,116,ct_1,2,t_3); ! phrase 18 ! [18: if the global attacker is at dodge , decrease the weight entry by 2] if (((Adj_85_t1_v64((Global_Vars-->63))))) { TableLookUpEntry(ct_0,116,ct_1,3,2); } ! phrase 19 ! [19: if d is greater than p , now the weight entry is -100] if (((t_2 > t_3))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 20 ! [20: if stored_weapon is not readied , now the weight entry is -100] if ((~~((Adj_81_t1_v64((Global_Vars-->75)))))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 21 ! [21: if the global attacker is at parry and the combat state of the global attacker is not react , now the weight entry is -100] if ((((Adj_83_t1_v64((Global_Vars-->63))))) && ((~~((ValueProperty((Global_Vars-->63),p76_combat_state) == Q77_react))))) { TableLookUpEntry(ct_0,116,ct_1,1,-100); } ! phrase 22 ! [22: end repeat] } if (debug_rules>1) print " [22: end repeat]^"; rfalse; ]; ! A standard AI action select rule ( this is the standard ready select rule ): [ R_918 ;blockv_stack-->(blockv_sp+7) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+6) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+5) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+4) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+3) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+2) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 8; blockv_stack-->(blockv_sp++) = R_SHELL_18(blockv_sp-8); blockv_sp = blockv_sp - 9; BlkFree(blockv_stack-->(blockv_sp+7)); BlkFree(blockv_stack-->(blockv_sp+6)); BlkFree(blockv_stack-->(blockv_sp+5)); BlkFree(blockv_stack-->(blockv_sp+4)); BlkFree(blockv_stack-->(blockv_sp+3)); BlkFree(blockv_stack-->(blockv_sp+2)); BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+8); ]; [ R_SHELL_18 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: if the stored_weapon is readied begin] if (((Adj_81_t1_v64((Global_Vars-->75))))) { ! phrase 2 ! [2: choose row with an option of the action of the global attacker readying the stored_weapon in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##A89_readying, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 3 ! [3: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 4 ! [4: otherwise] } else { ! phrase 5 ! [5: choose row with an option of the action of the global attacker attacking the global defender in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+2)), TryAction(0, (Global_Vars-->63), ##Attack, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+3)))) )); ! phrase 6 ! [6: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 7 ! [7: choose row with an option of the action of the global attacker concentrating in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+4)), TryAction(0, (Global_Vars-->63), ##A86_concentrating, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+5)))) )); ! phrase 8 ! [8: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 9 ! [9: choose row with an option of the action of the global attacker readying the stored_weapon in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+6)), TryAction(0, (Global_Vars-->63), ##A89_readying, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+7)))) )); ! phrase 10 ! [10: increase the weight entry by 5] TableLookUpEntry(ct_0,116,ct_1,2,5); ! phrase 11 ! [11: end if] } rfalse; ]; ! A standard AI action select rule ( this is the standard reloading select rule ): [ R_919 ;blockv_stack-->(blockv_sp+7) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+6) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+5) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+4) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+3) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+2) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 8; blockv_stack-->(blockv_sp++) = R_SHELL_19(blockv_sp-8); blockv_sp = blockv_sp - 9; BlkFree(blockv_stack-->(blockv_sp+7)); BlkFree(blockv_stack-->(blockv_sp+6)); BlkFree(blockv_stack-->(blockv_sp+5)); BlkFree(blockv_stack-->(blockv_sp+4)); BlkFree(blockv_stack-->(blockv_sp+3)); BlkFree(blockv_stack-->(blockv_sp+2)); BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+8); ]; [ R_SHELL_19 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: if the current shots of the stored_weapon is 0 and the maximum shots of the stored_weapon is not 0 begin] if ((((ValueProperty((Global_Vars-->75),p24_current_shots) == 0))) && ((~~((ValueProperty((Global_Vars-->75),p23_maximum_shots) == 0))))) { ! phrase 2 ! [2: choose row with an option of the action of the global attacker attacking the global defender in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##Attack, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 3 ! [3: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 4 ! [4: choose row with an option of the action of the global attacker concentrating in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+2)), TryAction(0, (Global_Vars-->63), ##A86_concentrating, 0, 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+3)))) )); ! phrase 5 ! [5: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 6 ! [6: choose row with an option of the action of the global attacker reloading the stored_weapon in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+4)), TryAction(0, (Global_Vars-->63), ##A90_reloading, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+5)))) )); ! phrase 7 ! [7: increase the weight entry by 5] TableLookUpEntry(ct_0,116,ct_1,2,5); ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: choose row with an option of the action of the global attacker reloading the stored_weapon in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+6)), TryAction(0, (Global_Vars-->63), ##A90_reloading, (Global_Vars-->75), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+7)))) )); ! phrase 10 ! [10: now the weight entry is -100] TableLookUpEntry(ct_0,116,ct_1,1,-100); ! phrase 11 ! [11: end if] } rfalse; ]; ! A standard AI action select rule ( this is the boar charge select rule ): [ R_969 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(84,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_20(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_20 I7BASPL ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: if the global attacker is the boar begin] if ((((Global_Vars-->63) == O46_boar))) { ! phrase 2 ! [2: choose row with an option of the action of the global attacker charging the global defender in the table of ai combat options] ct_0 = T7_ai_combat_options; ct_1 = TableRowCorr(ct_0, 117, BlkValueCopy((blockv_stack-->(I7BASPL+0)), TryAction(0, (Global_Vars-->63), ##A91_charging, (Global_Vars-->64), 0, STORED_ACTION_TY_Current((blockv_stack-->(I7BASPL+1)))) )); ! phrase 3 ! [3: increase the weight entry by 107] TableLookUpEntry(ct_0,116,ct_1,2,107); ! phrase 4 ! [4: end if] } rfalse; ]; ! Last standard AI action select rule ( this is the randomise the action result rule ): [ R_920 t_0 ! Local variable e.g. '?-1,-1?' = NUMBER_TY t_1 ! Local variable e.g. '?-1,-1?' = NUMBER_TY ct_0 ct_1 ! Used for table searches ; ! phrase 1 ! [1: repeat through the table of ai combat options begin] @push ct_0; @push ct_1; for (t_0=T7_ai_combat_options,t_1=1,ct_0=t_0,ct_1=t_1: t_1<=TableRows(t_0):t_1++,ct_0=t_0,ct_1=t_1) if (TableRowIsBlank(ct_0,ct_1)==false) { if (debug_rules>1) print " [repetition through row ", ct_1, "]^"; ! phrase 2 ! [2: increase the weight entry by a random number between 0 and 2] TableLookUpEntry(ct_0,116,ct_1,2, (GenerateRandomNumber(0, 2)) ); ! phrase 3 ! [3: say ~[Option entry]: [Weight entry][line break]~] say__p=1;ParaContent(); print (STORED_ACTION_TY_Say) TableLookUpEntry(ct_0,117,ct_1); ParaContent(); print (PrintText) SC_115; ParaContent(); print (say__n=TableLookUpEntry(ct_0,116,ct_1)); ParaContent(); new_line; .L_Say275; .L_SayX248; ! phrase 4 ! [4: end repeat] } @pull ct_1; @pull ct_0; if (debug_rules>1) print " [4: end repeat]^"; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: chance to win (B414_chance_to_win) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/8 ! First chance to win rule ( this is the CTW default rule ): ! --- now the mid-placed rules --- ! Rule 2/8 ! Chance to win rule ( this is the CTW concentration bonus rule ): ! === which is equally specific with === ! Rule 3/8 ! Chance to win rule ( this is the CTW parry bonus rule ): ! === which is equally specific with === ! Rule 4/8 ! Chance to win rule ( this is the CTW dodge bonus rule ): ! === which is equally specific with === ! Rule 5/8 ! Chance to win rule ( this is the CTW melee bonus rule ): ! === which is equally specific with === ! Rule 6/8 ! Chance to win rule ( this is the CTW defence bonus rule ): ! === which is equally specific with === ! Rule 7/8 ! Chance to win rule ( this is the CTW attack bonus from weapon rule ): ! --- now the last-placed rules --- ! Rule 8/8 ! Last chance to win rule ( this is the CTW no greater than 10 rule ): ! ---------------------------------------------------------------------------------------------------- ! First chance to win rule ( this is the CTW default rule ): [ R_910 ; ! phrase 1 ! [1: now the chance-to-win is 10] (Global_Vars-->78) = 10; rfalse; ]; ! Chance to win rule ( this is the CTW concentration bonus rule ): [ R_868 ; ! phrase 1 ! [1: if the concentration of the global attacker is 1 , increase the chance-to-win by 2] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 1))) { (Global_Vars-->78) = (Global_Vars-->78) + 2; } ! phrase 2 ! [2: if the concentration of the global attacker is 2 , increase the chance-to-win by 4] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 2))) { (Global_Vars-->78) = (Global_Vars-->78) + 4; } ! phrase 3 ! [3: if the concentration of the global attacker is 3 , increase the chance-to-win by 8] if (((ValueProperty((Global_Vars-->63),p17_concentration) == 3))) { (Global_Vars-->78) = (Global_Vars-->78) + 8; } rfalse; ]; ! Chance to win rule ( this is the CTW parry bonus rule ): [ R_872 t_0 ! Local variable e.g. 'n' = NUMBER_TY ; ! phrase 1 ! [1: if the global defender is at parry begin] if (((Adj_83_t1_v64((Global_Vars-->64))))) { ! phrase 2 ! [2: let n be the passive parry max of global attacker weapon] t_0 = ValueProperty((Global_Vars-->65),p20_passive_parry_max); ! phrase 3 ! [3: if the active parry max of global defender weapon is less than n , now n is the active parry max of global defender weapon] if (((ValueProperty((Global_Vars-->66),p21_active_parry_max) < t_0))) { t_0 = ValueProperty((Global_Vars-->66),p21_active_parry_max); } ! phrase 4 ! [4: decrease the chance-to-win by n] (Global_Vars-->78) = (Global_Vars-->78) - t_0; ! phrase 5 ! [5: end if] } rfalse; ]; ! Chance to win rule ( this is the CTW dodge bonus rule ): [ R_877 ; ! phrase 1 ! [1: if the global defender is at dodge , decrease the chance-to-win by the dodgability of the stored_weapon] if (((Adj_85_t1_v64((Global_Vars-->64))))) { (Global_Vars-->78) = (Global_Vars-->78) - ValueProperty((Global_Vars-->75),p19_dodgability); } rfalse; ]; ! Chance to win rule ( this is the CTW melee bonus rule ): [ R_911 ; ! phrase 1 ! [1: increase the chance-to-win by the melee of the global attacker] (Global_Vars-->78) = (Global_Vars-->78) + ValueProperty((Global_Vars-->63),p13_melee); rfalse; ]; ! Chance to win rule ( this is the CTW defence bonus rule ): [ R_912 ; ! phrase 1 ! [1: decrease the chance-to-win by the defence of the global attacker] (Global_Vars-->78) = (Global_Vars-->78) - ValueProperty((Global_Vars-->63),p14_defence); rfalse; ]; ! Chance to win rule ( this is the CTW attack bonus from weapon rule ): [ R_923 ; ! phrase 1 ! [1: increase the chance-to-win by the weapon attack bonus of the stored_weapon] (Global_Vars-->78) = (Global_Vars-->78) + ValueProperty((Global_Vars-->75),p22_weapon_attack_bonus); rfalse; ]; ! Last chance to win rule ( this is the CTW no greater than 10 rule ): [ R_913 ; ! phrase 1 ! [1: if the chance-to-win is greater than 10 , now the chance-to-win is 10] if ((((Global_Vars-->78) > 10))) { (Global_Vars-->78) = 10; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: standard_attacker (B415_standard_attacker) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! A standard_attacker rule: ! ---------------------------------------------------------------------------------------------------- ! A standard_attacker rule: [ R_921 ;blockv_stack-->(blockv_sp+0) = BlkValueCreate(84,0,0); blockv_sp = blockv_sp + 1; blockv_stack-->(blockv_sp++) = R_SHELL_21(blockv_sp-1); blockv_sp = blockv_sp - 2; BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+1); ]; [ R_SHELL_21 I7BASPL ; ! phrase 1 ! [1: have the ai select a target] (PHR_881()); ! phrase 2 ! [2: if the found-a-target boolean is true begin] if ((((Global_Vars-->77) == 1))) { ! phrase 3 ! [3: have the ai select a weapon] (PHR_892()); ! phrase 4 ! [4: have the ai select an action] (PHR_902()); ! phrase 5 ! [5: try the stored_action] STORED_ACTION_TY_Try(BlkValueCopy((blockv_stack-->(I7BASPL+0)), (Global_Vars-->76))); ! phrase 6 ! [6: end if] } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Readying (B417_carry_out_readying) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor readying: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor readying: [ R_924 t_0 ! Local variable e.g. '?-1,-1?' = OBJECT_TY t_1 ! Local variable e.g. '?-1,-1?' = OBJECT_TY ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_924, 924); ! phrase 1 ! [1: if the actor encloses the noun begin] if (((IndirectlyContains(actor,noun)))) { ! phrase 2 ! [2: now the noun is readied] Adj_81_t2_v64(noun); ! phrase 3 ! [3: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 4 ! [4: say ~[CAP-actor] read[ies] [the noun].~] say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_219; ParaContent(); (PHR_766());ParaContent(); print (PrintText) SC_42; ParaContent(); print (the) noun; ParaContent(); print (PrintText) SC_122; new_line; .L_Say276; .L_SayX249; ! phrase 5 ! [5: otherwise] } else { ! phrase 6 ! [6: try the actor taking the noun] TryAction(0, actor, ##Take, noun, 0);; ! phrase 7 ! [7: if the actor has the noun , now the noun is readied] if (((actor == OwnerOf(noun)))) { Adj_81_t2_v64(noun); } ! phrase 8 ! [8: end if] } ! phrase 9 ! [9: if the noun is readied begin] if (((Adj_81_t1_v64(noun)))) { ! phrase 10 ! [10: now the actor is not at parry] Adj_83_t3_v64(actor); ! phrase 11 ! [11: repeat with item running through things enclosed by the actor begin] for (t_0=Prop_41(,actor,0), t_1=Prop_41(,actor,t_0): t_0: t_0=t_1, t_1=Prop_41(,actor,t_1)) { if (debug_rules>1) print " [repetition with item set to ", (PrintShortName) t_0, "]^"; ! phrase 12 ! [12: if the item is not the noun and the item is readied , now the item is not readied] if (((~~((t_0 == noun)))) && (((Adj_81_t1_v64(t_0))))) { Adj_81_t3_v64(t_0); } ! phrase 13 ! [13: end repeat] } if (debug_rules>1) print " [13: end repeat]^"; ! phrase 14 ! [14: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_924, 924, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: flavour (B420_flavour) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Last flavour rule ( this is the basic flavour rule ): ! ---------------------------------------------------------------------------------------------------- ! Last flavour rule ( this is the basic flavour rule ): [ R_932 ; ! phrase 1 ! [1: if the final damage is greater than 0 begin] if ((((Global_Vars-->71) > 0))) { ! phrase 2 ! [2: say ~[CAP-attacker] hit[s] [the global defender].[run paragraph on]~] say__p=1;ParaContent(); (PHR_812());ParaContent(); print (PrintText) SC_220; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_42; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_122; ParaContent(); RunParagraphOn(); .L_Say277; .L_SayX250; ! phrase 3 ! [3: otherwise] } else { ! phrase 4 ! [4: say ~[CAP-attacker] miss[es] [the global defender].[run paragraph on]~] say__p=1;ParaContent(); (PHR_812());ParaContent(); print (PrintText) SC_221; ParaContent(); (PHR_764());ParaContent(); print (PrintText) SC_42; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_122; ParaContent(); RunParagraphOn(); .L_Say278; .L_SayX251; ! phrase 5 ! [5: end if] } ! phrase 6 ! [6: continue the action] rfalse; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: fatal player flavour (B421_fatal_player_flavour) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Last fatal player flavour rule ( this is the basic player flavour rule ): ! ---------------------------------------------------------------------------------------------------- ! Last fatal player flavour rule ( this is the basic player flavour rule ): [ R_933 ; ! phrase 1 ! [1: say ~You are killed by [the global attacker].~] say__p=1;ParaContent(); print (PrintText) SC_222; ParaContent(); print (the) (Global_Vars-->63); ParaContent(); print (PrintText) SC_122; new_line; .L_Say279; .L_SayX252; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: fatal flavour (B422_fatal_flavour) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Last fatal flavour rule ( this is the basic fatal flavour rule ): ! ---------------------------------------------------------------------------------------------------- ! Last fatal flavour rule ( this is the basic fatal flavour rule ): [ R_934 ;blockv_stack-->(blockv_sp+1) = BlkValueCreate(83,0,0); blockv_stack-->(blockv_sp+0) = BlkValueCreate(83,0,0); blockv_sp = blockv_sp + 2; blockv_stack-->(blockv_sp++) = R_SHELL_22(blockv_sp-2); blockv_sp = blockv_sp - 3; BlkFree(blockv_stack-->(blockv_sp+1)); BlkFree(blockv_stack-->(blockv_sp+0)); return blockv_stack-->(blockv_sp+2); ]; [ R_SHELL_22 I7BASPL ; ! phrase 1 ! [1: say ~[CAP-attacker] kill[s] [the global defender].~ in sentence case] say__p=1;ParaContent(); print (INDEXED_TEXT_TY_Say) IT_CharactersToCase((blockv_stack-->(I7BASPL+0)), BlkValueCast((blockv_stack-->(I7BASPL+1)),83,60,(text_routine_7)), 3) ; .L_Say280; .L_SayX253; rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: attack move flavour (B423_attack_move_flavour) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Last attack move flavour rule ( this is the basic attack move flavour rule ): ! ---------------------------------------------------------------------------------------------------- ! Last attack move flavour rule ( this is the basic attack move flavour rule ): [ R_935 ; ! phrase 1 ! [1: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 2 ! [2: if the actor is not the player , say ~[CAP-actor] lung[es] towards [the noun].[paragraph break]~] if ((~~((actor == player)))) { say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_223; ParaContent(); (PHR_764());ParaContent(); print (PrintText) SC_224; ParaContent(); print (the) noun; ParaContent(); print (PrintText) SC_122; ParaContent(); DivideParagraphPoint(); new_line; .L_Say281; .L_SayX254; } rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: check Reloading (B424_check_reloading) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Check reloading: ! ---------------------------------------------------------------------------------------------------- ! Check reloading: [ R_942 ; if (actor == player) { if (debug_rules) DB_Rule(R_942, 942); ! phrase 1 ! [1: if the maximum shots of the noun is 0 , say ~[The noun] does not use ammo.~ instead] if (((ValueProperty(noun,p23_maximum_shots) == 0))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_225; new_line; .L_Say282; .L_SayX255; rtrue; } ! phrase 2 ! [2: if the maximum load time of the noun is -1 , say ~[The noun] cannot be reloaded.~ instead] if (((ValueProperty(noun,p25_maximum_load_time) == -1))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_226; new_line; .L_Say283; .L_SayX256; rtrue; } ! phrase 3 ! [3: if the current shots of the noun is the maximum shots of the noun , say ~[The noun] is already loaded.~ instead] if (((ValueProperty(noun,p24_current_shots) == ValueProperty(noun,p23_maximum_shots)))) { say__p=1;ParaContent(); print (The) noun; ParaContent(); print (PrintText) SC_227; new_line; .L_Say284; .L_SayX257; rtrue; } } ! Runs only when actor is the player else if (debug_rules > 1) DB_Rule(R_942, 942, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Reloading (B425_carry_out_reloading) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor reloading: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor reloading: [ R_943 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_943, 943); ! phrase 1 ! [1: now the noun is readied] Adj_81_t2_v64(noun); ! phrase 2 ! [2: decrease the current load time of the noun by 1] WriteValueProperty(noun,p26_current_load_time,ValueProperty(noun,p26_current_load_time)-1); ! phrase 3 ! [3: now the global actor is the actor] (Global_Vars-->57) = actor; ! phrase 4 ! [4: if the current load time of the noun is 0 begin] if (((ValueProperty(noun,p26_current_load_time) == 0))) { ! phrase 5 ! [5: say ~[CAP-actor] [if the maximum load time of the noun is 1]reload[s][otherwise]finish[es] reloading[end if] [the noun].~] say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_42; if (~~((((ValueProperty(noun,p25_maximum_load_time) == 1))))) jump L_Say285; ParaContent(); print (PrintText) SC_228; ParaContent(); STextSubstitution(); jump L_SayX258; .L_Say285; ParaContent(); print (PrintText) SC_229; ParaContent(); (PHR_764());ParaContent(); print (PrintText) SC_230; .L_Say286; .L_SayX258; ParaContent(); print (PrintText) SC_42; ParaContent(); print (the) noun; ParaContent(); print (PrintText) SC_122; new_line; .L_Say287; .L_SayX259; ! phrase 6 ! [6: now the current shots of the noun is the maximum shots of the noun] WriteValueProperty(noun,p24_current_shots,ValueProperty(noun,p23_maximum_shots)); ! phrase 7 ! [7: now the current load time of the noun is the maximum load time of the noun] WriteValueProperty(noun,p26_current_load_time,ValueProperty(noun,p25_maximum_load_time)); ! phrase 8 ! [8: otherwise] } else { ! phrase 9 ! [9: say ~[CAP-actor] [if the current shots of the noun is not 0]discard[s] the old ammo, and [end if][if the current load time of the noun plus 1 is the maximum load time of the noun]start[s][otherwise]continue[s][end if] reloading [the noun].~] say__p=1;ParaContent(); (PHR_814());ParaContent(); print (PrintText) SC_42; if (~~(((~~((ValueProperty(noun,p24_current_shots) == 0)))))) jump L_Say288; ParaContent(); print (PrintText) SC_231; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_232; .L_Say288; .L_SayX260; if (~~(((( (ValueProperty(noun,p26_current_load_time)+1) == ValueProperty(noun,p25_maximum_load_time)))))) jump L_Say289; ParaContent(); print (PrintText) SC_233; ParaContent(); STextSubstitution(); jump L_SayX261; .L_Say289; ParaContent(); print (PrintText) SC_234; ParaContent(); STextSubstitution(); .L_Say290; .L_SayX261; ParaContent(); print (PrintText) SC_235; ParaContent(); print (the) noun; ParaContent(); print (PrintText) SC_122; new_line; .L_Say291; .L_SayX262; ! phrase 10 ! [10: now the current shots of the noun is 0] WriteValueProperty(noun,p24_current_shots,0); ! phrase 11 ! [11: end if] } } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_943, 943, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------------------- ! Rules in rulebook: carry out Charging (B428_carry_out_charging) ! ---------------------------------------------------------------------------------------------------- ! Rule 1/1 ! Carry out an actor charging: ! ---------------------------------------------------------------------------------------------------- ! Carry out an actor charging: [ R_949 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_949, 949); ! phrase 1 ! [1: now the charge boolean is true] (Global_Vars-->79) = 1; ! phrase 2 ! [2: try the actor attacking the noun] TryAction(0, actor, ##Attack, noun, 0);; ! phrase 3 ! [3: now the charge boolean is false] (Global_Vars-->79) = 0; } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_949, 949, true); rfalse; ]; ! ---------------------------------------------------------------------------------------------------- ! Definitions of displaced and unbooked rules ! From the Standard Rules ! Check an actor attacking ( this is the block attacking rule ): [ R_226 ; if ((act_requester==nothing)) { ! Runs only when pattern matches if (debug_rules) DB_Rule(R_226, 226); ! phrase 1 ! [1: stop the action with library message attacking action number 1 for the noun] return GL__M(##Attack,1,noun); } ! Runs only when pattern matches else if (debug_rules > 1) DB_Rule(R_226, 226, true); rfalse; ]; ! Definitions of miscellaneous remaining rules ! From the Standard Rules ! Definition: [ R_0 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_1 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_2 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_3 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_4 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_34 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_35 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_36 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_37 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_38 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_39 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_40 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_41 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_42 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_43 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_44 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_45 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! From the Standard Rules ! Definition: [ R_69 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! Definition: [ R_819 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! Definition: [ R_820 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; ! Definition: [ R_936 t_0 ! Call parameter 'it' = OBJECT_TY ; rfalse; ]; [ Adj_0_t1_v64 ! meaning of "visible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return ((((TestVisibility(player,t_0))))); rfalse; ]; [ Adj_1_t1_v64 ! meaning of "invisible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return (~~(((((TestVisibility(player,t_0))))))); rfalse; ]; [ Adj_2_t1_v64 ! meaning of "touchable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return ((((TestTouchability(player,t_0))))); rfalse; ]; [ Adj_3_t1_v64 ! meaning of "untouchable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return (~~(((((TestTouchability(player,t_0))))))); rfalse; ]; [ Adj_4_t1_v64 ! meaning of "concealed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return ((((TestConcealment( (HolderOf(t_0)) ,t_0))))); rfalse; ]; [ Adj_5_t1_v64 ! meaning of "unconcealed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return (~~(((((TestConcealment( (HolderOf(t_0)) ,t_0))))))); rfalse; ]; [ Adj_6_t1_v64 ! meaning of "on-stage" t_0 ! Call parameter 'it' = NUMBER_TY ; if (t_0 ofclass K2_thing) return ((OnStage(t_0))); rfalse; ]; [ Adj_7_t1_v64 ! meaning of "off-stage" t_0 ! Call parameter 'it' = NUMBER_TY ; if (t_0 ofclass K2_thing) return (~~(((OnStage(t_0))))); rfalse; ]; [ Adj_8_t1_v64 ! meaning of "adjacent" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K1_room) return ((((TestAdjacency(real_location,t_0))))); rfalse; ]; [ Adj_9_t1_v57 ! meaning of "even" t_0 ! Call parameter 'it' = NUMBER_TY ; return (((( (IntegerRemainder(t_0,2)) == 0)))); rfalse; ]; [ Adj_10_t1_v57 ! meaning of "odd" t_0 ! Call parameter 'it' = NUMBER_TY ; return (~~((((( (IntegerRemainder(t_0,2)) == 0)))))); rfalse; ]; [ Adj_11_t1_v57 ! meaning of "positive" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((((t_0 > 0)))); rfalse; ]; [ Adj_12_t1_v57 ! meaning of "negative" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((((t_0 < 0)))); rfalse; ]; [ Adj_13_t1_v59 ! meaning of "empty" t_0 ! Call parameter 'it' = TEXT_TY ; return ((((t_0 == EMPTY_TEXT_VALUE)))); rfalse; ]; [ Adj_13_t1_v83 ! meaning of "empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((INDEXED_TEXT_TY_Empty(t_0))); rfalse; ]; [ Adj_13_t1_v74 ! meaning of "empty" t_0 ! Call parameter 'it' = TABLE_TY ; return (((( TableFilledRows(t_0) == 0)))); rfalse; ]; [ Adj_13_t1_v69 ! meaning of "empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((RulebookEmpty(t_0))); rfalse; ]; [ Adj_13_t1_v72 ! meaning of "empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((ActivityEmpty(t_0))); rfalse; ]; [ Adj_13_t1_v85 ! meaning of "empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((LIST_OF_TY_Empty(t_0))); rfalse; ]; [ Adj_14_t1_v59 ! meaning of "non-empty" t_0 ! Call parameter 'it' = TEXT_TY ; return (~~(((((t_0 == EMPTY_TEXT_VALUE)))))); rfalse; ]; [ Adj_14_t1_v83 ! meaning of "non-empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return (~~(((INDEXED_TEXT_TY_Empty(t_0))))); rfalse; ]; [ Adj_14_t1_v74 ! meaning of "non-empty" t_0 ! Call parameter 'it' = TABLE_TY ; return (~~((((( TableFilledRows(t_0) == 0)))))); rfalse; ]; [ Adj_14_t1_v69 ! meaning of "non-empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return (~~(((RulebookEmpty(t_0))))); rfalse; ]; [ Adj_14_t1_v72 ! meaning of "non-empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return (~~(((ActivityEmpty(t_0))))); rfalse; ]; [ Adj_14_t1_v85 ! meaning of "non-empty" t_0 ! Call parameter 'it' = NUMBER_TY ; return (~~(((LIST_OF_TY_Empty(t_0))))); rfalse; ]; [ Adj_15_t1_v73 ! meaning of "happening" t_0 ! Call parameter 'it' = SCENE_TY ; return ((scene_status-->(t_0-1)==1)); rfalse; ]; [ Adj_16_t1_v74 ! meaning of "full" t_0 ! Call parameter 'it' = TABLE_TY ; return (((( TableBlankRows(t_0) == 0)))); rfalse; ]; [ Adj_17_t1_v74 ! meaning of "non-full" t_0 ! Call parameter 'it' = TABLE_TY ; return (~~((((( TableBlankRows(t_0) == 0)))))); rfalse; ]; [ Adj_18_t1_v72 ! meaning of "going on" t_0 ! Call parameter 'it' = NUMBER_TY ; return ((TestActivity(t_0))); rfalse; ]; [ Adj_19_t1_v64 ! meaning of "locale-supportable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K2_thing) return ((((~~((Adj_35_t1_v64(t_0))))) && (((~~((Adj_48_t1_v64(t_0))))) && ((~~((Adj_45_t1_v64(t_0)))))))); rfalse; ]; [ Adj_20_t1_v64 ! meaning of "alive" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K8_person) return (t_0.p10_health >= 1); rfalse; ]; [ Adj_21_t1_v64 ! meaning of "killed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K8_person) return (t_0.p10_health <= 0); rfalse; ]; [ Adj_22_t1_v64 ! meaning of "unloaded" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0 ofclass K31_weapon) return (((((ValueProperty(t_0,p24_current_shots) == 0))) && ((~~((ValueProperty(t_0,p23_maximum_shots) == 0)))))); rfalse; ]; [ Adj_23_t1_v64 ! meaning of "privately-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,privately_named)); rfalse; ]; [ Adj_24_t1_v64 ! meaning of "publically-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,privately_named)==false); rfalse; ]; [ Adj_25_t1_v64 ! meaning of "lighted" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_26_t1_v64 ! meaning of "dark" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,light)==false); rfalse; ]; [ Adj_27_t1_v64 ! meaning of "visited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,visited)); rfalse; ]; [ Adj_28_t1_v64 ! meaning of "unvisited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,visited)==false); rfalse; ]; [ Adj_29_t1_v64 ! meaning of "lit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_30_t1_v64 ! meaning of "unlit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,light)==false); rfalse; ]; [ Adj_31_t1_v64 ! meaning of "edible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,edible)); rfalse; ]; [ Adj_32_t1_v64 ! meaning of "inedible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,edible)==false); rfalse; ]; [ Adj_33_t1_v64 ! meaning of "fixed in place" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,static)); rfalse; ]; [ Adj_34_t1_v64 ! meaning of "portable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,static)==false); rfalse; ]; [ Adj_35_t1_v64 ! meaning of "scenery" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,scenery)); rfalse; ]; [ Adj_36_t1_v64 ! meaning of "wearable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,clothing)); rfalse; ]; [ Adj_37_t1_v64 ! meaning of "pushable between rooms" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,pushable)); rfalse; ]; [ Adj_38_t1_v64 ! meaning of "handled" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,moved)); rfalse; ]; [ Adj_39_t1_v64 ! meaning of "initially carried" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,initially_carried)); rfalse; ]; [ Adj_40_t1_v64 ! meaning of "plural-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,pluralname)); rfalse; ]; [ Adj_41_t1_v64 ! meaning of "singular-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,pluralname)==false); rfalse; ]; [ Adj_42_t1_v64 ! meaning of "proper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,proper)); rfalse; ]; [ Adj_43_t1_v64 ! meaning of "improper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,proper)==false); rfalse; ]; [ Adj_44_t1_v64 ! meaning of "described" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,concealed)==false); rfalse; ]; [ Adj_45_t1_v64 ! meaning of "undescribed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,concealed)); rfalse; ]; [ Adj_46_t1_v64 ! meaning of "marked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,workflag)); rfalse; ]; [ Adj_47_t1_v64 ! meaning of "unmarked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,workflag)==false); rfalse; ]; [ Adj_48_t1_v64 ! meaning of "mentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,mentioned)); rfalse; ]; [ Adj_49_t1_v64 ! meaning of "unmentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,mentioned)==false); rfalse; ]; [ Adj_50_t1_v64 ! meaning of "enterable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,enterable)); rfalse; ]; [ Adj_51_t1_v64 ! meaning of "opaque" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,transparent)==false); rfalse; ]; [ Adj_52_t1_v64 ! meaning of "transparent" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,transparent)); rfalse; ]; [ Adj_53_t1_v64 ! meaning of "open" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,open)); rfalse; ]; [ Adj_54_t1_v64 ! meaning of "closed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,open)==false); rfalse; ]; [ Adj_55_t1_v64 ! meaning of "openable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,openable)); rfalse; ]; [ Adj_56_t1_v64 ! meaning of "unopenable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,openable)==false); rfalse; ]; [ Adj_57_t1_v64 ! meaning of "lockable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,lockable)); rfalse; ]; [ Adj_58_t1_v64 ! meaning of "locked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,locked)); rfalse; ]; [ Adj_59_t1_v64 ! meaning of "unlocked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,locked)==false); rfalse; ]; [ Adj_60_t1_v64 ! meaning of "female" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,female)); rfalse; ]; [ Adj_61_t1_v64 ! meaning of "male" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,female)==false); rfalse; ]; [ Adj_62_t1_v64 ! meaning of "neuter" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,neuter)); rfalse; ]; [ Adj_63_t1_v64 ! meaning of "switched on" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,on)); rfalse; ]; [ Adj_64_t1_v64 ! meaning of "switched off" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,on)==false); rfalse; ]; [ Adj_65_t1_v73 ! meaning of "recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (PropertyKOV(KOVP_73, 0, t_0)); rfalse; ]; [ Adj_66_t1_v73 ! meaning of "non-recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (PropertyKOV(KOVP_73, 0, t_0) == false); rfalse; ]; [ Adj_67_t1_v64 ! meaning of "ambiguously plural" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p72_ambiguously_plural)); rfalse; ]; [ Adj_68_t1_v64 ! meaning of "ordinarily enumerated" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p72_ambiguously_plural)==false); rfalse; ]; [ Adj_69_t1_v64 ! meaning of "neutral" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 1); rfalse; ]; [ Adj_70_t1_v64 ! meaning of "friendly" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 2); rfalse; ]; [ Adj_71_t1_v64 ! meaning of "hostile" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 3); rfalse; ]; [ Adj_72_t1_v64 ! meaning of "hostile_2" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 4); rfalse; ]; [ Adj_73_t1_v64 ! meaning of "hostile_3" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 5); rfalse; ]; [ Adj_74_t1_v64 ! meaning of "hostile_4" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p74_hostility) == 6); rfalse; ]; [ Adj_75_t1_v64 ! meaning of "None" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p76_combat_state) == 1); rfalse; ]; [ Adj_76_t1_v64 ! meaning of "Acted" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p76_combat_state) == 2); rfalse; ]; [ Adj_77_t1_v64 ! meaning of "React" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p76_combat_state) == 3); rfalse; ]; [ Adj_78_t1_v64 ! meaning of "No React" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p77_react_state) == 1); rfalse; ]; [ Adj_79_t1_v64 ! meaning of "Defensive" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p77_react_state) == 2); rfalse; ]; [ Adj_80_t1_v64 ! meaning of "Aggressive" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (ValueProperty(t_0,p77_react_state) == 3); rfalse; ]; [ Adj_81_t1_v64 ! meaning of "readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p78_readied)); rfalse; ]; [ Adj_82_t1_v64 ! meaning of "not readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p78_readied)==false); rfalse; ]; [ Adj_83_t1_v64 ! meaning of "at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p80_at_parry)); rfalse; ]; [ Adj_84_t1_v64 ! meaning of "not at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p80_at_parry)==false); rfalse; ]; [ Adj_85_t1_v64 ! meaning of "at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p82_at_dodge)); rfalse; ]; [ Adj_86_t1_v64 ! meaning of "not at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (GetEitherOrProperty(t_0,p82_at_dodge)==false); rfalse; ]; [ Adj_23_t2_v64 ! meaning of "privately-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,privately_named)); rfalse; ]; [ Adj_24_t2_v64 ! meaning of "publically-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,privately_named,true)); rfalse; ]; [ Adj_25_t2_v64 ! meaning of "lighted" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_26_t2_v64 ! meaning of "dark" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light,true)); rfalse; ]; [ Adj_27_t2_v64 ! meaning of "visited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,visited)); rfalse; ]; [ Adj_28_t2_v64 ! meaning of "unvisited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,visited,true)); rfalse; ]; [ Adj_29_t2_v64 ! meaning of "lit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_30_t2_v64 ! meaning of "unlit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light,true)); rfalse; ]; [ Adj_31_t2_v64 ! meaning of "edible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,edible)); rfalse; ]; [ Adj_32_t2_v64 ! meaning of "inedible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,edible,true)); rfalse; ]; [ Adj_33_t2_v64 ! meaning of "fixed in place" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,static)); rfalse; ]; [ Adj_34_t2_v64 ! meaning of "portable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,static,true)); rfalse; ]; [ Adj_35_t2_v64 ! meaning of "scenery" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,scenery)); rfalse; ]; [ Adj_36_t2_v64 ! meaning of "wearable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,clothing)); rfalse; ]; [ Adj_37_t2_v64 ! meaning of "pushable between rooms" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pushable)); rfalse; ]; [ Adj_38_t2_v64 ! meaning of "handled" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,moved)); rfalse; ]; [ Adj_39_t2_v64 ! meaning of "initially carried" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,initially_carried)); rfalse; ]; [ Adj_40_t2_v64 ! meaning of "plural-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pluralname)); rfalse; ]; [ Adj_41_t2_v64 ! meaning of "singular-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pluralname,true)); rfalse; ]; [ Adj_42_t2_v64 ! meaning of "proper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,proper)); rfalse; ]; [ Adj_43_t2_v64 ! meaning of "improper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,proper,true)); rfalse; ]; [ Adj_44_t2_v64 ! meaning of "described" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,concealed,true)); rfalse; ]; [ Adj_45_t2_v64 ! meaning of "undescribed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,concealed)); rfalse; ]; [ Adj_46_t2_v64 ! meaning of "marked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,workflag)); rfalse; ]; [ Adj_47_t2_v64 ! meaning of "unmarked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,workflag,true)); rfalse; ]; [ Adj_48_t2_v64 ! meaning of "mentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,mentioned)); rfalse; ]; [ Adj_49_t2_v64 ! meaning of "unmentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,mentioned,true)); rfalse; ]; [ Adj_50_t2_v64 ! meaning of "enterable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,enterable)); rfalse; ]; [ Adj_51_t2_v64 ! meaning of "opaque" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,transparent,true)); rfalse; ]; [ Adj_52_t2_v64 ! meaning of "transparent" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,transparent)); rfalse; ]; [ Adj_53_t2_v64 ! meaning of "open" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,open)); rfalse; ]; [ Adj_54_t2_v64 ! meaning of "closed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,open,true)); rfalse; ]; [ Adj_55_t2_v64 ! meaning of "openable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,openable)); rfalse; ]; [ Adj_56_t2_v64 ! meaning of "unopenable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,openable,true)); rfalse; ]; [ Adj_57_t2_v64 ! meaning of "lockable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,lockable)); rfalse; ]; [ Adj_58_t2_v64 ! meaning of "locked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,locked)); rfalse; ]; [ Adj_59_t2_v64 ! meaning of "unlocked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,locked,true)); rfalse; ]; [ Adj_60_t2_v64 ! meaning of "female" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,female)); rfalse; ]; [ Adj_61_t2_v64 ! meaning of "male" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,female,true)); rfalse; ]; [ Adj_62_t2_v64 ! meaning of "neuter" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,neuter)); rfalse; ]; [ Adj_63_t2_v64 ! meaning of "switched on" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,on)); rfalse; ]; [ Adj_64_t2_v64 ! meaning of "switched off" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,on,true)); rfalse; ]; [ Adj_65_t2_v73 ! meaning of "recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (WritePropertyKOV(KOVP_73, 0, t_0, true)); rfalse; ]; [ Adj_66_t2_v73 ! meaning of "non-recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (WritePropertyKOV(KOVP_73, 0, t_0)); rfalse; ]; [ Adj_67_t2_v64 ! meaning of "ambiguously plural" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p72_ambiguously_plural)); rfalse; ]; [ Adj_68_t2_v64 ! meaning of "ordinarily enumerated" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p72_ambiguously_plural,true)); rfalse; ]; [ Adj_69_t2_v64 ! meaning of "neutral" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,1)); rfalse; ]; [ Adj_70_t2_v64 ! meaning of "friendly" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,2)); rfalse; ]; [ Adj_71_t2_v64 ! meaning of "hostile" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,3)); rfalse; ]; [ Adj_72_t2_v64 ! meaning of "hostile_2" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,4)); rfalse; ]; [ Adj_73_t2_v64 ! meaning of "hostile_3" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,5)); rfalse; ]; [ Adj_74_t2_v64 ! meaning of "hostile_4" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p74_hostility,6)); rfalse; ]; [ Adj_75_t2_v64 ! meaning of "None" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p76_combat_state,1)); rfalse; ]; [ Adj_76_t2_v64 ! meaning of "Acted" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p76_combat_state,2)); rfalse; ]; [ Adj_77_t2_v64 ! meaning of "React" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p76_combat_state,3)); rfalse; ]; [ Adj_78_t2_v64 ! meaning of "No React" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p77_react_state,1)); rfalse; ]; [ Adj_79_t2_v64 ! meaning of "Defensive" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p77_react_state,2)); rfalse; ]; [ Adj_80_t2_v64 ! meaning of "Aggressive" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (WriteValueProperty(t_0,p77_react_state,3)); rfalse; ]; [ Adj_81_t2_v64 ! meaning of "readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p78_readied)); rfalse; ]; [ Adj_82_t2_v64 ! meaning of "not readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p78_readied,true)); rfalse; ]; [ Adj_83_t2_v64 ! meaning of "at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p80_at_parry)); rfalse; ]; [ Adj_84_t2_v64 ! meaning of "not at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p80_at_parry,true)); rfalse; ]; [ Adj_85_t2_v64 ! meaning of "at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p82_at_dodge)); rfalse; ]; [ Adj_86_t2_v64 ! meaning of "not at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p82_at_dodge,true)); rfalse; ]; [ Adj_23_t3_v64 ! meaning of "privately-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,privately_named,true)); rfalse; ]; [ Adj_24_t3_v64 ! meaning of "publically-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,privately_named)); rfalse; ]; [ Adj_25_t3_v64 ! meaning of "lighted" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light,true)); rfalse; ]; [ Adj_26_t3_v64 ! meaning of "dark" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_27_t3_v64 ! meaning of "visited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,visited,true)); rfalse; ]; [ Adj_28_t3_v64 ! meaning of "unvisited" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,visited)); rfalse; ]; [ Adj_29_t3_v64 ! meaning of "lit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light,true)); rfalse; ]; [ Adj_30_t3_v64 ! meaning of "unlit" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,light)); rfalse; ]; [ Adj_31_t3_v64 ! meaning of "edible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,edible,true)); rfalse; ]; [ Adj_32_t3_v64 ! meaning of "inedible" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,edible)); rfalse; ]; [ Adj_33_t3_v64 ! meaning of "fixed in place" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,static,true)); rfalse; ]; [ Adj_34_t3_v64 ! meaning of "portable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,static)); rfalse; ]; [ Adj_35_t3_v64 ! meaning of "scenery" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,scenery,true)); rfalse; ]; [ Adj_36_t3_v64 ! meaning of "wearable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,clothing,true)); rfalse; ]; [ Adj_37_t3_v64 ! meaning of "pushable between rooms" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pushable,true)); rfalse; ]; [ Adj_38_t3_v64 ! meaning of "handled" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,moved,true)); rfalse; ]; [ Adj_39_t3_v64 ! meaning of "initially carried" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,initially_carried,true)); rfalse; ]; [ Adj_40_t3_v64 ! meaning of "plural-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pluralname,true)); rfalse; ]; [ Adj_41_t3_v64 ! meaning of "singular-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,pluralname)); rfalse; ]; [ Adj_42_t3_v64 ! meaning of "proper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,proper,true)); rfalse; ]; [ Adj_43_t3_v64 ! meaning of "improper-named" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,proper)); rfalse; ]; [ Adj_44_t3_v64 ! meaning of "described" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,concealed)); rfalse; ]; [ Adj_45_t3_v64 ! meaning of "undescribed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,concealed,true)); rfalse; ]; [ Adj_46_t3_v64 ! meaning of "marked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,workflag,true)); rfalse; ]; [ Adj_47_t3_v64 ! meaning of "unmarked for listing" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,workflag)); rfalse; ]; [ Adj_48_t3_v64 ! meaning of "mentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,mentioned,true)); rfalse; ]; [ Adj_49_t3_v64 ! meaning of "unmentioned" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,mentioned)); rfalse; ]; [ Adj_50_t3_v64 ! meaning of "enterable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,enterable,true)); rfalse; ]; [ Adj_51_t3_v64 ! meaning of "opaque" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,transparent)); rfalse; ]; [ Adj_52_t3_v64 ! meaning of "transparent" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,transparent,true)); rfalse; ]; [ Adj_53_t3_v64 ! meaning of "open" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,open,true)); rfalse; ]; [ Adj_54_t3_v64 ! meaning of "closed" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,open)); rfalse; ]; [ Adj_55_t3_v64 ! meaning of "openable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,openable,true)); rfalse; ]; [ Adj_56_t3_v64 ! meaning of "unopenable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,openable)); rfalse; ]; [ Adj_57_t3_v64 ! meaning of "lockable" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,lockable,true)); rfalse; ]; [ Adj_58_t3_v64 ! meaning of "locked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,locked,true)); rfalse; ]; [ Adj_59_t3_v64 ! meaning of "unlocked" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,locked)); rfalse; ]; [ Adj_60_t3_v64 ! meaning of "female" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,female,true)); rfalse; ]; [ Adj_61_t3_v64 ! meaning of "male" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,female)); rfalse; ]; [ Adj_62_t3_v64 ! meaning of "neuter" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,neuter,true)); rfalse; ]; [ Adj_63_t3_v64 ! meaning of "switched on" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,on,true)); rfalse; ]; [ Adj_64_t3_v64 ! meaning of "switched off" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,on)); rfalse; ]; [ Adj_65_t3_v73 ! meaning of "recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (WritePropertyKOV(KOVP_73, 0, t_0)); rfalse; ]; [ Adj_66_t3_v73 ! meaning of "non-recurring" t_0 ! Call parameter 'it' = SCENE_TY ; return (WritePropertyKOV(KOVP_73, 0, t_0, true)); rfalse; ]; [ Adj_67_t3_v64 ! meaning of "ambiguously plural" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p72_ambiguously_plural,true)); rfalse; ]; [ Adj_68_t3_v64 ! meaning of "ordinarily enumerated" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p72_ambiguously_plural)); rfalse; ]; [ Adj_81_t3_v64 ! meaning of "readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p78_readied,true)); rfalse; ]; [ Adj_82_t3_v64 ! meaning of "not readied" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p78_readied)); rfalse; ]; [ Adj_83_t3_v64 ! meaning of "at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p80_at_parry,true)); rfalse; ]; [ Adj_84_t3_v64 ! meaning of "not at parry" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p80_at_parry)); rfalse; ]; [ Adj_85_t3_v64 ! meaning of "at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p82_at_dodge,true)); rfalse; ]; [ Adj_86_t3_v64 ! meaning of "not at dodge" t_0 ! Call parameter 'it' = OBJECT_TY ; if (t_0) return (SetEitherOrProperty(t_0,p82_at_dodge)); rfalse; ]; Array TimedEventsTable table 0 0; Array TimedEventTimesTable table 0 0; Array rulebooks_array --> B0_procedural B1_startup B2_turn_sequence B3_shutdown B4_scene_changing B5_when_play_begins B6_when_play_ends B7_every_turn B8_action_processing B9_setting_action_variables B10_specific_action_processi B11_player_s_action_awarenes B12_accessibility B13_reaching_inside B14_reaching_outside B15_visibility B16_persuasion B17_unsuccessful_attempt_by B18_before B19_instead B20_check B21_carry_out B22_after B23_report B24_does_the_player_mean B25_when_entire_game_begins B26_when_entire_game_ends B27_before_printing_the_name B28_for_printing_the_name B29_after_printing_the_name B30_before_printing_the_plur B31_for_printing_the_plural_ B32_after_printing_the_plura B33_before_printing_a_number B34_for_printing_a_number B35_after_printing_a_number B36_before_printing_room_des B37_for_printing_room_descri B38_after_printing_room_desc B39_before_listing_contents B40_for_listing_contents B41_after_listing_contents B42_before_grouping_together B43_for_grouping_together B44_after_grouping_together B45_before_writing_a_paragra B46_for_writing_a_paragraph_ B47_after_writing_a_paragrap B48_before_listing_nondescri B49_for_listing_nondescript_ B50_after_listing_nondescrip B51_before_printing_the_name B52_for_printing_the_name_of B53_after_printing_the_name_ B54_before_printing_the_desc B55_for_printing_the_descrip B56_after_printing_the_descr B57_before_printing_the_anno B58_for_printing_the_announc B59_after_printing_the_annou B60_before_printing_the_anno B61_for_printing_the_announc B62_after_printing_the_annou B63_before_printing_a_refusa B64_for_printing_a_refusal_t B65_after_printing_a_refusal B66_before_constructing_the_ B67_for_constructing_the_sta B68_after_constructing_the_s B69_before_printing_the_bann B70_for_printing_the_banner_ B71_after_printing_the_banne B72_before_reading_a_command B73_for_reading_a_command B74_after_reading_a_command B75_before_deciding_the_scop B76_for_deciding_the_scope B77_after_deciding_the_scope B78_before_deciding_the_conc B79_for_deciding_the_conceal B80_after_deciding_the_conce B81_before_deciding_whether_ B82_for_deciding_whether_all B83_after_deciding_whether_a B84_before_clarifying_the_pa B85_for_clarifying_the_parse B86_after_clarifying_the_par B87_before_asking_which_do_y B88_for_asking_which_do_you_ B89_after_asking_which_do_yo B90_before_printing_a_parser B91_for_printing_a_parser_er B92_after_printing_a_parser_ B93_before_supplying_a_missi B94_for_supplying_a_missing_ B95_after_supplying_a_missin B96_before_supplying_a_missi B97_for_supplying_a_missing_ B98_after_supplying_a_missin B99_before_implicitly_taking B100_for_implicitly_taking B101_after_implicitly_taking B102_before_starting_the_vir B103_for_starting_the_virtua B104_after_starting_the_virt B105_before_amusing_a_victor B106_for_amusing_a_victoriou B107_after_amusing_a_victori B108_before_printing_the_pla B109_for_printing_the_player B110_after_printing_the_play B111_before_handling_the_fin B112_for_handling_the_final_ B113_after_handling_the_fina B114_before_printing_the_loc B115_for_printing_the_locale B116_after_printing_the_loca B117_before_choosing_notable B118_for_choosing_notable_lo B119_after_choosing_notable_ B120_before_printing_a_local B121_for_printing_a_locale_p B122_after_printing_a_locale B123_check_taking_inventory B124_carry_out_taking_invent B125_report_taking_inventory B126_check_taking B127_carry_out_taking B128_report_taking B129_check_removing_it_from B130_carry_out_removing_it_f B131_report_removing_it_from B132_check_dropping B133_carry_out_dropping B134_report_dropping B135_check_putting_it_on B136_carry_out_putting_it_on B137_report_putting_it_on B138_check_inserting_it_into B139_carry_out_inserting_it_ B140_report_inserting_it_int B141_check_eating B142_carry_out_eating B143_report_eating B144_check_going B145_carry_out_going B146_report_going B147_check_entering B148_carry_out_entering B149_report_entering B150_check_exiting B151_carry_out_exiting B152_report_exiting B153_check_getting_off B154_carry_out_getting_off B155_report_getting_off B156_check_looking B157_carry_out_looking B158_report_looking B159_check_examining B160_carry_out_examining B161_report_examining B162_check_looking_under B163_carry_out_looking_under B164_report_looking_under B165_check_searching B166_carry_out_searching B167_report_searching B168_check_consulting_it_abo B169_carry_out_consulting_it B170_report_consulting_it_ab B171_check_locking_it_with B172_carry_out_locking_it_wi B173_report_locking_it_with B174_check_unlocking_it_with B175_carry_out_unlocking_it_ B176_report_unlocking_it_wit B177_check_switching_on B178_carry_out_switching_on B179_report_switching_on B180_check_switching_off B181_carry_out_switching_off B182_report_switching_off B183_check_opening B184_carry_out_opening B185_report_opening B186_check_closing B187_carry_out_closing B188_report_closing B189_check_wearing B190_carry_out_wearing B191_report_wearing B192_check_taking_off B193_carry_out_taking_off B194_report_taking_off B195_check_giving_it_to B196_carry_out_giving_it_to B197_report_giving_it_to B198_check_showing_it_to B199_carry_out_showing_it_to B200_report_showing_it_to B201_check_waking B202_carry_out_waking B203_report_waking B204_check_throwing_it_at B205_carry_out_throwing_it_a B206_report_throwing_it_at B207_check_attacking B208_carry_out_attacking B209_report_attacking B210_check_kissing B211_carry_out_kissing B212_report_kissing B213_check_answering_it_that B214_carry_out_answering_it_ B215_report_answering_it_tha B216_check_telling_it_about B217_carry_out_telling_it_ab B218_report_telling_it_about B219_check_asking_it_about B220_carry_out_asking_it_abo B221_report_asking_it_about B222_check_asking_it_for B223_carry_out_asking_it_for B224_report_asking_it_for B225_check_waiting B226_carry_out_waiting B227_report_waiting B228_check_touching B229_carry_out_touching B230_report_touching B231_check_waving B232_carry_out_waving B233_report_waving B234_check_pulling B235_carry_out_pulling B236_report_pulling B237_check_pushing B238_carry_out_pushing B239_report_pushing B240_check_turning B241_carry_out_turning B242_report_turning B243_check_pushing_it_to B244_carry_out_pushing_it_to B245_report_pushing_it_to B246_check_squeezing B247_carry_out_squeezing B248_report_squeezing B249_check_saying_yes B250_carry_out_saying_yes B251_report_saying_yes B252_check_saying_no B253_carry_out_saying_no B254_report_saying_no B255_check_burning B256_carry_out_burning B257_report_burning B258_check_waking_up B259_carry_out_waking_up B260_report_waking_up B261_check_thinking B262_carry_out_thinking B263_report_thinking B264_check_smelling B265_carry_out_smelling B266_report_smelling B267_check_listening_to B268_carry_out_listening_to B269_report_listening_to B270_check_tasting B271_carry_out_tasting B272_report_tasting B273_check_cutting B274_carry_out_cutting B275_report_cutting B276_check_jumping B277_carry_out_jumping B278_report_jumping B279_check_tying_it_to B280_carry_out_tying_it_to B281_report_tying_it_to B282_check_drinking B283_carry_out_drinking B284_report_drinking B285_check_saying_sorry B286_carry_out_saying_sorry B287_report_saying_sorry B288_check_swearing_obscenel B289_carry_out_swearing_obsc B290_report_swearing_obscene B291_check_swearing_mildly B292_carry_out_swearing_mild B293_report_swearing_mildly B294_check_swinging B295_carry_out_swinging B296_report_swinging B297_check_rubbing B298_carry_out_rubbing B299_report_rubbing B300_check_setting_it_to B301_carry_out_setting_it_to B302_report_setting_it_to B303_check_waving_hands B304_carry_out_waving_hands B305_report_waving_hands B306_check_buying B307_carry_out_buying B308_report_buying B309_check_singing B310_carry_out_singing B311_report_singing B312_check_climbing B313_carry_out_climbing B314_report_climbing B315_check_sleeping B316_carry_out_sleeping B317_report_sleeping B318_check_quitting_the_game B319_carry_out_quitting_the_ B320_report_quitting_the_gam B321_check_saving_the_game B322_carry_out_saving_the_ga B323_report_saving_the_game B324_check_restoring_the_gam B325_carry_out_restoring_the B326_report_restoring_the_ga B327_check_restarting_the_ga B328_carry_out_restarting_th B329_report_restarting_the_g B330_check_verifying_the_sto B331_carry_out_verifying_the B332_report_verifying_the_st B333_check_switching_the_sto B334_carry_out_switching_the B335_report_switching_the_st B336_check_switching_the_sto B337_carry_out_switching_the B338_report_switching_the_st B339_check_requesting_the_st B340_carry_out_requesting_th B341_report_requesting_the_s B342_check_requesting_the_sc B343_carry_out_requesting_th B344_report_requesting_the_s B345_check_preferring_abbrev B346_carry_out_preferring_ab B347_report_preferring_abbre B348_check_preferring_unabbr B349_carry_out_preferring_un B350_report_preferring_unabb B351_check_preferring_someti B352_carry_out_preferring_so B353_report_preferring_somet B354_check_switching_score_n B355_carry_out_switching_sco B356_report_switching_score_ B357_check_switching_score_n B358_carry_out_switching_sco B359_report_switching_score_ B360_check_requesting_the_pr B361_carry_out_requesting_th B362_report_requesting_the_p B363_check_finding_responses B364_carry_out_finding_respo B365_report_finding_response B366_check_giving_text_for B367_carry_out_giving_text_f B368_report_giving_text_for B369_check_giving_link_to B370_carry_out_giving_link_t B371_report_giving_link_to B372_check_preparing B373_carry_out_preparing B374_report_preparing B375_check_switching_the_num B376_carry_out_switching_the B377_report_switching_the_nu B378_check_switching_the_num B379_carry_out_switching_the B380_report_switching_the_nu B381_reset_combat_variables B382_whether_attacking_begin B383_preliminary_results_of_ B384_basic_attack_roll B385_whether_attack_modifier B386_attack_modifiers B387_always_present_attack_m B388_show_results_of_the_att B389_whether_the_attack_hit B390_immediate_results_of_hi B391_basic_damage_roll B392_damage_modifiers B393_printing_the_damage B394_final_damage B395_report_no_final_damage B396_non_fatal_damage B397_fatal_damage B398_take_away_until_attack_ B399_print_flavour_text B400_aftereffects B401_final_blow_report B402_check_concentrating B403_carry_out_concentrating B404_report_concentrating B405_check_parrying B406_carry_out_parrying B407_report_parrying B408_check_dodging B409_carry_out_dodging B410_report_dodging B411_standard_ai_target_sele B412_standard_ai_weapon_sele B413_standard_ai_action_sele B414_chance_to_win B415_standard_attacker B416_check_readying B417_carry_out_readying B418_report_readying B419_intervening_flavour_tex B420_flavour B421_fatal_player_flavour B422_fatal_flavour B423_attack_move_flavour B424_check_reloading B425_carry_out_reloading B426_report_reloading B427_check_charging B428_carry_out_charging B429_report_charging 0; Constant B0_procedural = EMPTY_RULEBOOK; Array B1_startup --> VIRTUAL_MACHINE_STARTUP_R INITIALISE_MEMORY_R SEED_RANDOM_NUMBER_GENERATOR_R UPDATE_CHRONOLOGICAL_RECORDS_R POSITION_PLAYER_IN_MODEL_R R_5 R_6 R_7 R_8 R_9 NULL; ! 10 rule(s) Array B2_turn_sequence --> PARSE_COMMAND_R GENERATE_ACTION_R R_817 R_11 R_831 R_10 TIMED_EVENTS_R ADVANCE_TIME_R UPDATE_CHRONOLOGICAL_RECORDS_R R_12 R_833 ADJUST_LIGHT_R NOTE_OBJECT_ACQUISITIONS_R R_13 NULL; ! 14 rule(s) Array B3_shutdown --> R_14 RESURRECT_PLAYER_IF_ASKED_R R_15 ASK_FINAL_QUESTION_R NULL; ! 4 rule(s) Array B4_scene_changing --> DetectSceneChange NULL; ! 1 rule(s) Array B5_when_play_begins --> R_830 R_720 R_740 R_799 R_805 R_821 R_824 R_930 NULL; ! 8 rule(s) Constant B6_when_play_ends = EMPTY_RULEBOOK; Array B7_every_turn --> R_930 R_794 R_836 NULL; ! 3 rule(s) Array B8_action_processing --> R_17 R_16 R_18 BASIC_VISIBILITY_R BASIC_ACCESSIBILITY_R CARRYING_REQUIREMENTS_R R_19 REQUESTED_ACTIONS_REQUIRE_R CARRY_OUT_REQUESTED_ACTIONS_R DESCEND_TO_SPECIFIC_ACTION_R R_20 NULL; ! 11 rule(s) Array B9_setting_action_variables --> R_123 R_155 R_143 NULL; ! 3 rule(s) Array B10_specific_action_processi --> WORK_OUT_DETAILS_OF_SPECIFIC_R R_21 R_22 R_23 R_24 R_25 R_26 R_27 NULL; ! 8 rule(s) Array B11_player_s_action_awarenes --> R_28 R_29 R_30 R_31 NULL; ! 4 rule(s) Array B12_accessibility --> ACCESS_THROUGH_BARRIERS_R NULL; ! 1 rule(s) Array B13_reaching_inside --> CANT_REACH_INSIDE_ROOMS_R CANT_REACH_INSIDE_CLOSED_R NULL; ! 2 rule(s) Array B14_reaching_outside --> CANT_REACH_OUTSIDE_CLOSED_R NULL; ! 1 rule(s) Array B15_visibility --> R_32 NULL; ! 1 rule(s) Constant B16_persuasion = EMPTY_RULEBOOK; Constant B17_unsuccessful_attempt_by = EMPTY_RULEBOOK; Array B18_before --> R_801 R_804 NULL; ! 2 rule(s) Array B19_instead --> (-2) ##Examine 4 R_950 R_743 R_951 R_952 ##A81_giving_text_for 2 R_717 R_954 ##A80_finding_responses_to R_955 ##A82_giving_link_to R_956 ##A81_giving_text_for R_957 ##A80_finding_responses_to R_958 ##A82_giving_link_to R_959 ##A81_giving_text_for R_960 ##A80_finding_responses_to R_961 ##A82_giving_link_to R_962 ##A81_giving_text_for R_963 ##A80_finding_responses_to R_964 ##A82_giving_link_to R_965 ##A81_giving_text_for R_966 ##A82_giving_link_to R_967 ##A81_giving_text_for R_968 ##Examine 2 R_929 R_946 NULL; ! 22 rule(s) Constant B20_check = EMPTY_RULEBOOK; Constant B21_carry_out = EMPTY_RULEBOOK; Array B22_after --> R_927 R_928 R_926 NULL; ! 3 rule(s) Constant B23_report = EMPTY_RULEBOOK; Array B24_does_the_player_mean --> R_940 R_941 R_33 NULL; ! 3 rule(s) Constant B25_when_entire_game_begins = EMPTY_RULEBOOK; Constant B26_when_entire_game_ends = EMPTY_RULEBOOK; Array B27_before_printing_the_name --> R_46 NULL; ! 1 rule(s) Array B28_for_printing_the_name --> R_811 STANDARD_NAME_PRINTING_R NULL; ! 2 rule(s) Array B29_after_printing_the_name --> R_925 R_937 R_795 R_753 NULL; ! 4 rule(s) Constant B30_before_printing_the_plur = EMPTY_RULEBOOK; Array B31_for_printing_the_plural_ --> R_47 NULL; ! 1 rule(s) Constant B32_after_printing_the_plura = EMPTY_RULEBOOK; Constant B33_before_printing_a_number = EMPTY_RULEBOOK; Array B34_for_printing_a_number --> R_48 NULL; ! 1 rule(s) Constant B35_after_printing_a_number = EMPTY_RULEBOOK; Constant B36_before_printing_room_des = EMPTY_RULEBOOK; Constant B37_for_printing_room_descri = EMPTY_RULEBOOK; Constant B38_after_printing_room_desc = EMPTY_RULEBOOK; Constant B39_before_listing_contents = EMPTY_RULEBOOK; Array B40_for_listing_contents --> STANDARD_CONTENTS_LISTING_R NULL; ! 1 rule(s) Constant B41_after_listing_contents = EMPTY_RULEBOOK; Constant B42_before_grouping_together = EMPTY_RULEBOOK; Constant B43_for_grouping_together = EMPTY_RULEBOOK; Constant B44_after_grouping_together = EMPTY_RULEBOOK; Constant B45_before_writing_a_paragra = EMPTY_RULEBOOK; Constant B46_for_writing_a_paragraph_ = EMPTY_RULEBOOK; Constant B47_after_writing_a_paragrap = EMPTY_RULEBOOK; Constant B48_before_listing_nondescri = EMPTY_RULEBOOK; Constant B49_for_listing_nondescript_ = EMPTY_RULEBOOK; Constant B50_after_listing_nondescrip = EMPTY_RULEBOOK; Constant B51_before_printing_the_name = EMPTY_RULEBOOK; Constant B52_for_printing_the_name_of = EMPTY_RULEBOOK; Constant B53_after_printing_the_name_ = EMPTY_RULEBOOK; Constant B54_before_printing_the_desc = EMPTY_RULEBOOK; Constant B55_for_printing_the_descrip = EMPTY_RULEBOOK; Constant B56_after_printing_the_descr = EMPTY_RULEBOOK; Constant B57_before_printing_the_anno = EMPTY_RULEBOOK; Constant B58_for_printing_the_announc = EMPTY_RULEBOOK; Constant B59_after_printing_the_annou = EMPTY_RULEBOOK; Constant B60_before_printing_the_anno = EMPTY_RULEBOOK; Array B61_for_printing_the_announc --> R_49 NULL; ! 1 rule(s) Constant B62_after_printing_the_annou = EMPTY_RULEBOOK; Constant B63_before_printing_a_refusa = EMPTY_RULEBOOK; Constant B64_for_printing_a_refusal_t = EMPTY_RULEBOOK; Constant B65_after_printing_a_refusal = EMPTY_RULEBOOK; Constant B66_before_constructing_the_ = EMPTY_RULEBOOK; Constant B67_for_constructing_the_sta = EMPTY_RULEBOOK; Constant B68_after_constructing_the_s = EMPTY_RULEBOOK; Constant B69_before_printing_the_bann = EMPTY_RULEBOOK; Constant B70_for_printing_the_banner_ = EMPTY_RULEBOOK; Constant B71_after_printing_the_banne = EMPTY_RULEBOOK; Constant B72_before_reading_a_command = EMPTY_RULEBOOK; Constant B73_for_reading_a_command = EMPTY_RULEBOOK; Constant B74_after_reading_a_command = EMPTY_RULEBOOK; Constant B75_before_deciding_the_scop = EMPTY_RULEBOOK; Constant B76_for_deciding_the_scope = EMPTY_RULEBOOK; Constant B77_after_deciding_the_scope = EMPTY_RULEBOOK; Constant B78_before_deciding_the_conc = EMPTY_RULEBOOK; Constant B79_for_deciding_the_conceal = EMPTY_RULEBOOK; Constant B80_after_deciding_the_conce = EMPTY_RULEBOOK; Constant B81_before_deciding_whether_ = EMPTY_RULEBOOK; Array B82_for_deciding_whether_all --> R_741 R_742 NULL; ! 2 rule(s) Constant B83_after_deciding_whether_a = EMPTY_RULEBOOK; Constant B84_before_clarifying_the_pa = EMPTY_RULEBOOK; Constant B85_for_clarifying_the_parse = EMPTY_RULEBOOK; Constant B86_after_clarifying_the_par = EMPTY_RULEBOOK; Constant B87_before_asking_which_do_y = EMPTY_RULEBOOK; Constant B88_for_asking_which_do_you_ = EMPTY_RULEBOOK; Constant B89_after_asking_which_do_yo = EMPTY_RULEBOOK; Constant B90_before_printing_a_parser = EMPTY_RULEBOOK; Constant B91_for_printing_a_parser_er = EMPTY_RULEBOOK; Constant B92_after_printing_a_parser_ = EMPTY_RULEBOOK; Constant B93_before_supplying_a_missi = EMPTY_RULEBOOK; Array B94_for_supplying_a_missing_ --> R_50 R_51 R_52 NULL; ! 3 rule(s) Constant B95_after_supplying_a_missin = EMPTY_RULEBOOK; Constant B96_before_supplying_a_missi = EMPTY_RULEBOOK; Constant B97_for_supplying_a_missing_ = EMPTY_RULEBOOK; Constant B98_after_supplying_a_missin = EMPTY_RULEBOOK; Constant B99_before_implicitly_taking = EMPTY_RULEBOOK; Constant B100_for_implicitly_taking = EMPTY_RULEBOOK; Constant B101_after_implicitly_taking = EMPTY_RULEBOOK; Constant B102_before_starting_the_vir = EMPTY_RULEBOOK; Array B103_for_starting_the_virtua --> ENABLE_GLULX_ACCEL_R NULL; ! 1 rule(s) Constant B104_after_starting_the_virt = EMPTY_RULEBOOK; Constant B105_before_amusing_a_victor = EMPTY_RULEBOOK; Constant B106_for_amusing_a_victoriou = EMPTY_RULEBOOK; Constant B107_after_amusing_a_victori = EMPTY_RULEBOOK; Constant B108_before_printing_the_pla = EMPTY_RULEBOOK; Array B109_for_printing_the_player --> PRINT_OBITUARY_HEADLINE_R PRINT_FINAL_SCORE_R DISPLAY_FINAL_STATUS_LINE_R NULL; ! 3 rule(s) Constant B110_after_printing_the_play = EMPTY_RULEBOOK; Array B111_before_handling_the_fin --> R_54 R_53 READ_FINAL_ANSWER_R NULL; ! 3 rule(s) Array B112_for_handling_the_final_ --> R_55 NULL; ! 1 rule(s) Constant B113_after_handling_the_fina = EMPTY_RULEBOOK; Array B114_before_printing_the_loc --> R_58 R_59 NULL; ! 2 rule(s) Array B115_for_printing_the_locale --> R_60 R_61 NULL; ! 2 rule(s) Constant B116_after_printing_the_loca = EMPTY_RULEBOOK; Constant B117_before_choosing_notable = EMPTY_RULEBOOK; Array B118_for_choosing_notable_lo --> R_62 NULL; ! 1 rule(s) Constant B119_after_choosing_notable_ = EMPTY_RULEBOOK; Constant B120_before_printing_a_local = EMPTY_RULEBOOK; Array B121_for_printing_a_locale_p --> R_63 R_64 R_65 R_66 R_67 R_68 R_70 NULL; ! 7 rule(s) Constant B122_after_printing_a_locale = EMPTY_RULEBOOK; Constant B123_check_taking_inventory = EMPTY_RULEBOOK; Array B124_carry_out_taking_invent --> R_71 R_72 R_73 NULL; ! 3 rule(s) Array B125_report_taking_inventory --> R_74 NULL; ! 1 rule(s) Array B126_check_taking --> R_75 R_76 R_77 R_78 R_79 R_80 R_81 R_82 R_83 R_84 R_85 R_86 NULL; ! 12 rule(s) Array B127_carry_out_taking --> R_87 NULL; ! 1 rule(s) Array B128_report_taking --> R_88 NULL; ! 1 rule(s) Array B129_check_removing_it_from --> R_77 R_89 R_90 R_91 NULL; ! 4 rule(s) Constant B130_carry_out_removing_it_f = EMPTY_RULEBOOK; Constant B131_report_removing_it_from = EMPTY_RULEBOOK; Array B132_check_dropping --> R_92 R_93 R_94 R_95 R_96 NULL; ! 5 rule(s) Array B133_carry_out_dropping --> R_97 NULL; ! 1 rule(s) Array B134_report_dropping --> R_98 NULL; ! 1 rule(s) Array B135_check_putting_it_on --> R_99 R_100 R_101 R_102 R_103 R_104 R_105 NULL; ! 7 rule(s) Array B136_carry_out_putting_it_on --> R_106 NULL; ! 1 rule(s) Array B137_report_putting_it_on --> R_107 R_108 NULL; ! 2 rule(s) Array B138_check_inserting_it_into --> R_109 R_110 R_111 R_112 R_113 R_114 R_115 NULL; ! 7 rule(s) Array B139_carry_out_inserting_it_ --> R_116 NULL; ! 1 rule(s) Array B140_report_inserting_it_int --> R_117 R_118 NULL; ! 2 rule(s) Array B141_check_eating --> R_119 R_120 NULL; ! 2 rule(s) Array B142_carry_out_eating --> R_121 NULL; ! 1 rule(s) Array B143_report_eating --> R_122 NULL; ! 1 rule(s) Array B144_check_going --> R_953 R_124 R_125 R_126 R_127 R_128 NULL; ! 6 rule(s) Array B145_carry_out_going --> R_129 R_130 R_131 NULL; ! 3 rule(s) Array B146_report_going --> R_132 NULL; ! 1 rule(s) Array B147_check_entering --> R_133 R_134 R_135 R_136 R_137 R_138 R_139 NULL; ! 7 rule(s) Array B148_carry_out_entering --> R_140 NULL; ! 1 rule(s) Array B149_report_entering --> R_141 R_142 NULL; ! 2 rule(s) Array B150_check_exiting --> R_144 R_145 R_146 R_147 NULL; ! 4 rule(s) Array B151_carry_out_exiting --> R_148 NULL; ! 1 rule(s) Array B152_report_exiting --> R_149 R_150 NULL; ! 2 rule(s) Array B153_check_getting_off --> R_151 NULL; ! 1 rule(s) Array B154_carry_out_getting_off --> R_152 NULL; ! 1 rule(s) Array B155_report_getting_off --> R_153 R_154 NULL; ! 2 rule(s) Constant B156_check_looking = EMPTY_RULEBOOK; Array B157_carry_out_looking --> R_156 R_157 R_158 R_159 NULL; ! 4 rule(s) Array B158_report_looking --> R_160 NULL; ! 1 rule(s) Constant B159_check_examining = EMPTY_RULEBOOK; Array B160_carry_out_examining --> R_161 R_162 R_163 R_164 R_165 R_166 NULL; ! 6 rule(s) Array B161_report_examining --> R_167 NULL; ! 1 rule(s) Constant B162_check_looking_under = EMPTY_RULEBOOK; Array B163_carry_out_looking_under --> R_168 NULL; ! 1 rule(s) Array B164_report_looking_under --> R_169 NULL; ! 1 rule(s) Array B165_check_searching --> R_170 R_171 NULL; ! 2 rule(s) Constant B166_carry_out_searching = EMPTY_RULEBOOK; Array B167_report_searching --> R_172 R_173 R_174 NULL; ! 3 rule(s) Constant B168_check_consulting_it_abo = EMPTY_RULEBOOK; Constant B169_carry_out_consulting_it = EMPTY_RULEBOOK; Array B170_report_consulting_it_ab --> R_175 NULL; ! 1 rule(s) Array B171_check_locking_it_with --> R_176 R_177 R_178 R_179 NULL; ! 4 rule(s) Array B172_carry_out_locking_it_wi --> R_180 NULL; ! 1 rule(s) Array B173_report_locking_it_with --> R_181 NULL; ! 1 rule(s) Array B174_check_unlocking_it_with --> R_182 R_183 R_184 NULL; ! 3 rule(s) Array B175_carry_out_unlocking_it_ --> R_185 NULL; ! 1 rule(s) Array B176_report_unlocking_it_wit --> R_186 NULL; ! 1 rule(s) Array B177_check_switching_on --> R_187 R_188 NULL; ! 2 rule(s) Array B178_carry_out_switching_on --> R_189 NULL; ! 1 rule(s) Array B179_report_switching_on --> R_190 NULL; ! 1 rule(s) Array B180_check_switching_off --> R_191 R_192 NULL; ! 2 rule(s) Array B181_carry_out_switching_off --> R_193 NULL; ! 1 rule(s) Array B182_report_switching_off --> R_194 NULL; ! 1 rule(s) Array B183_check_opening --> R_195 R_196 R_197 NULL; ! 3 rule(s) Array B184_carry_out_opening --> R_198 NULL; ! 1 rule(s) Array B185_report_opening --> R_199 R_200 NULL; ! 2 rule(s) Array B186_check_closing --> R_201 R_202 NULL; ! 2 rule(s) Array B187_carry_out_closing --> R_203 NULL; ! 1 rule(s) Array B188_report_closing --> R_204 NULL; ! 1 rule(s) Array B189_check_wearing --> R_205 R_206 R_207 NULL; ! 3 rule(s) Array B190_carry_out_wearing --> R_208 NULL; ! 1 rule(s) Array B191_report_wearing --> R_209 NULL; ! 1 rule(s) Array B192_check_taking_off --> R_210 NULL; ! 1 rule(s) Array B193_carry_out_taking_off --> R_211 NULL; ! 1 rule(s) Array B194_report_taking_off --> R_212 NULL; ! 1 rule(s) Array B195_check_giving_it_to --> R_213 R_214 R_215 R_216 NULL; ! 4 rule(s) Array B196_carry_out_giving_it_to --> R_217 NULL; ! 1 rule(s) Array B197_report_giving_it_to --> R_218 NULL; ! 1 rule(s) Array B198_check_showing_it_to --> R_219 R_220 R_221 NULL; ! 3 rule(s) Constant B199_carry_out_showing_it_to = EMPTY_RULEBOOK; Constant B200_report_showing_it_to = EMPTY_RULEBOOK; Array B201_check_waking --> R_222 NULL; ! 1 rule(s) Constant B202_carry_out_waking = EMPTY_RULEBOOK; Constant B203_report_waking = EMPTY_RULEBOOK; Array B204_check_throwing_it_at --> R_223 R_224 R_225 NULL; ! 3 rule(s) Constant B205_carry_out_throwing_it_a = EMPTY_RULEBOOK; Constant B206_report_throwing_it_at = EMPTY_RULEBOOK; Array B207_check_attacking --> R_855 R_856 R_857 R_858 R_939 NULL; ! 5 rule(s) Array B208_carry_out_attacking --> R_859 R_860 NULL; ! 2 rule(s) Constant B209_report_attacking = EMPTY_RULEBOOK; Array B210_check_kissing --> R_227 R_228 NULL; ! 2 rule(s) Constant B211_carry_out_kissing = EMPTY_RULEBOOK; Constant B212_report_kissing = EMPTY_RULEBOOK; Constant B213_check_answering_it_that = EMPTY_RULEBOOK; Constant B214_carry_out_answering_it_ = EMPTY_RULEBOOK; Array B215_report_answering_it_tha --> R_229 NULL; ! 1 rule(s) Array B216_check_telling_it_about --> R_230 NULL; ! 1 rule(s) Constant B217_carry_out_telling_it_ab = EMPTY_RULEBOOK; Array B218_report_telling_it_about --> R_231 NULL; ! 1 rule(s) Constant B219_check_asking_it_about = EMPTY_RULEBOOK; Constant B220_carry_out_asking_it_abo = EMPTY_RULEBOOK; Array B221_report_asking_it_about --> R_232 NULL; ! 1 rule(s) Array B222_check_asking_it_for --> R_233 R_234 NULL; ! 2 rule(s) Constant B223_carry_out_asking_it_for = EMPTY_RULEBOOK; Constant B224_report_asking_it_for = EMPTY_RULEBOOK; Constant B225_check_waiting = EMPTY_RULEBOOK; Array B226_carry_out_waiting --> R_827 NULL; ! 1 rule(s) Array B227_report_waiting --> R_235 NULL; ! 1 rule(s) Constant B228_check_touching = EMPTY_RULEBOOK; Constant B229_carry_out_touching = EMPTY_RULEBOOK; Array B230_report_touching --> R_236 R_237 R_238 NULL; ! 3 rule(s) Array B231_check_waving --> R_239 NULL; ! 1 rule(s) Constant B232_carry_out_waving = EMPTY_RULEBOOK; Array B233_report_waving --> R_240 NULL; ! 1 rule(s) Array B234_check_pulling --> R_241 R_242 R_243 NULL; ! 3 rule(s) Constant B235_carry_out_pulling = EMPTY_RULEBOOK; Array B236_report_pulling --> R_244 NULL; ! 1 rule(s) Array B237_check_pushing --> R_245 R_246 R_247 NULL; ! 3 rule(s) Constant B238_carry_out_pushing = EMPTY_RULEBOOK; Array B239_report_pushing --> R_248 NULL; ! 1 rule(s) Array B240_check_turning --> R_249 R_250 R_251 NULL; ! 3 rule(s) Constant B241_carry_out_turning = EMPTY_RULEBOOK; Array B242_report_turning --> R_252 NULL; ! 1 rule(s) Array B243_check_pushing_it_to --> R_253 R_254 R_255 R_256 R_257 NULL; ! 5 rule(s) Constant B244_carry_out_pushing_it_to = EMPTY_RULEBOOK; Constant B245_report_pushing_it_to = EMPTY_RULEBOOK; Array B246_check_squeezing --> R_258 NULL; ! 1 rule(s) Constant B247_carry_out_squeezing = EMPTY_RULEBOOK; Array B248_report_squeezing --> R_259 NULL; ! 1 rule(s) Array B249_check_saying_yes --> R_260 NULL; ! 1 rule(s) Constant B250_carry_out_saying_yes = EMPTY_RULEBOOK; Constant B251_report_saying_yes = EMPTY_RULEBOOK; Array B252_check_saying_no --> R_261 NULL; ! 1 rule(s) Constant B253_carry_out_saying_no = EMPTY_RULEBOOK; Constant B254_report_saying_no = EMPTY_RULEBOOK; Array B255_check_burning --> R_262 NULL; ! 1 rule(s) Constant B256_carry_out_burning = EMPTY_RULEBOOK; Constant B257_report_burning = EMPTY_RULEBOOK; Array B258_check_waking_up --> R_263 NULL; ! 1 rule(s) Constant B259_carry_out_waking_up = EMPTY_RULEBOOK; Constant B260_report_waking_up = EMPTY_RULEBOOK; Array B261_check_thinking --> R_264 NULL; ! 1 rule(s) Constant B262_carry_out_thinking = EMPTY_RULEBOOK; Constant B263_report_thinking = EMPTY_RULEBOOK; Array B264_check_smelling --> R_265 NULL; ! 1 rule(s) Constant B265_carry_out_smelling = EMPTY_RULEBOOK; Constant B266_report_smelling = EMPTY_RULEBOOK; Array B267_check_listening_to --> R_266 NULL; ! 1 rule(s) Constant B268_carry_out_listening_to = EMPTY_RULEBOOK; Constant B269_report_listening_to = EMPTY_RULEBOOK; Array B270_check_tasting --> R_267 NULL; ! 1 rule(s) Constant B271_carry_out_tasting = EMPTY_RULEBOOK; Constant B272_report_tasting = EMPTY_RULEBOOK; Array B273_check_cutting --> R_268 NULL; ! 1 rule(s) Constant B274_carry_out_cutting = EMPTY_RULEBOOK; Constant B275_report_cutting = EMPTY_RULEBOOK; Array B276_check_jumping --> R_269 NULL; ! 1 rule(s) Constant B277_carry_out_jumping = EMPTY_RULEBOOK; Constant B278_report_jumping = EMPTY_RULEBOOK; Array B279_check_tying_it_to --> R_270 NULL; ! 1 rule(s) Constant B280_carry_out_tying_it_to = EMPTY_RULEBOOK; Constant B281_report_tying_it_to = EMPTY_RULEBOOK; Array B282_check_drinking --> R_271 NULL; ! 1 rule(s) Constant B283_carry_out_drinking = EMPTY_RULEBOOK; Constant B284_report_drinking = EMPTY_RULEBOOK; Array B285_check_saying_sorry --> R_272 NULL; ! 1 rule(s) Constant B286_carry_out_saying_sorry = EMPTY_RULEBOOK; Constant B287_report_saying_sorry = EMPTY_RULEBOOK; Array B288_check_swearing_obscenel --> R_273 NULL; ! 1 rule(s) Constant B289_carry_out_swearing_obsc = EMPTY_RULEBOOK; Constant B290_report_swearing_obscene = EMPTY_RULEBOOK; Array B291_check_swearing_mildly --> R_274 NULL; ! 1 rule(s) Constant B292_carry_out_swearing_mild = EMPTY_RULEBOOK; Constant B293_report_swearing_mildly = EMPTY_RULEBOOK; Array B294_check_swinging --> R_275 NULL; ! 1 rule(s) Constant B295_carry_out_swinging = EMPTY_RULEBOOK; Constant B296_report_swinging = EMPTY_RULEBOOK; Array B297_check_rubbing --> R_276 NULL; ! 1 rule(s) Constant B298_carry_out_rubbing = EMPTY_RULEBOOK; Constant B299_report_rubbing = EMPTY_RULEBOOK; Array B300_check_setting_it_to --> R_277 NULL; ! 1 rule(s) Constant B301_carry_out_setting_it_to = EMPTY_RULEBOOK; Constant B302_report_setting_it_to = EMPTY_RULEBOOK; Array B303_check_waving_hands --> R_278 NULL; ! 1 rule(s) Constant B304_carry_out_waving_hands = EMPTY_RULEBOOK; Constant B305_report_waving_hands = EMPTY_RULEBOOK; Array B306_check_buying --> R_279 NULL; ! 1 rule(s) Constant B307_carry_out_buying = EMPTY_RULEBOOK; Constant B308_report_buying = EMPTY_RULEBOOK; Array B309_check_singing --> R_280 NULL; ! 1 rule(s) Constant B310_carry_out_singing = EMPTY_RULEBOOK; Constant B311_report_singing = EMPTY_RULEBOOK; Array B312_check_climbing --> R_281 NULL; ! 1 rule(s) Constant B313_carry_out_climbing = EMPTY_RULEBOOK; Constant B314_report_climbing = EMPTY_RULEBOOK; Array B315_check_sleeping --> R_282 NULL; ! 1 rule(s) Constant B316_carry_out_sleeping = EMPTY_RULEBOOK; Constant B317_report_sleeping = EMPTY_RULEBOOK; Constant B318_check_quitting_the_game = EMPTY_RULEBOOK; Array B319_carry_out_quitting_the_ --> QUIT_THE_GAME_R NULL; ! 1 rule(s) Constant B320_report_quitting_the_gam = EMPTY_RULEBOOK; Constant B321_check_saving_the_game = EMPTY_RULEBOOK; Array B322_carry_out_saving_the_ga --> SAVE_THE_GAME_R NULL; ! 1 rule(s) Constant B323_report_saving_the_game = EMPTY_RULEBOOK; Constant B324_check_restoring_the_gam = EMPTY_RULEBOOK; Array B325_carry_out_restoring_the --> RESTORE_THE_GAME_R NULL; ! 1 rule(s) Constant B326_report_restoring_the_ga = EMPTY_RULEBOOK; Constant B327_check_restarting_the_ga = EMPTY_RULEBOOK; Array B328_carry_out_restarting_th --> RESTART_THE_GAME_R NULL; ! 1 rule(s) Constant B329_report_restarting_the_g = EMPTY_RULEBOOK; Constant B330_check_verifying_the_sto = EMPTY_RULEBOOK; Array B331_carry_out_verifying_the --> VERIFY_THE_STORY_FILE_R NULL; ! 1 rule(s) Constant B332_report_verifying_the_st = EMPTY_RULEBOOK; Constant B333_check_switching_the_sto = EMPTY_RULEBOOK; Array B334_carry_out_switching_the --> SWITCH_TRANSCRIPT_ON_R NULL; ! 1 rule(s) Constant B335_report_switching_the_st = EMPTY_RULEBOOK; Constant B336_check_switching_the_sto = EMPTY_RULEBOOK; Array B337_carry_out_switching_the --> SWITCH_TRANSCRIPT_OFF_R NULL; ! 1 rule(s) Constant B338_report_switching_the_st = EMPTY_RULEBOOK; Constant B339_check_requesting_the_st = EMPTY_RULEBOOK; Array B340_carry_out_requesting_th --> ANNOUNCE_STORY_FILE_VERSION_R NULL; ! 1 rule(s) Constant B341_report_requesting_the_s = EMPTY_RULEBOOK; Constant B342_check_requesting_the_sc = EMPTY_RULEBOOK; Array B343_carry_out_requesting_th --> ANNOUNCE_SCORE_R NULL; ! 1 rule(s) Constant B344_report_requesting_the_s = EMPTY_RULEBOOK; Constant B345_check_preferring_abbrev = EMPTY_RULEBOOK; Array B346_carry_out_preferring_ab --> PREFER_ABBREVIATED_R NULL; ! 1 rule(s) Array B347_report_preferring_abbre --> REP_PREFER_ABBREVIATED_R NULL; ! 1 rule(s) Constant B348_check_preferring_unabbr = EMPTY_RULEBOOK; Array B349_carry_out_preferring_un --> PREFER_UNABBREVIATED_R NULL; ! 1 rule(s) Array B350_report_preferring_unabb --> REP_PREFER_UNABBREVIATED_R NULL; ! 1 rule(s) Constant B351_check_preferring_someti = EMPTY_RULEBOOK; Array B352_carry_out_preferring_so --> PREFER_SOMETIMES_ABBREVIATED_R NULL; ! 1 rule(s) Array B353_report_preferring_somet --> REP_PREFER_SOMETIMES_ABBR_R NULL; ! 1 rule(s) Constant B354_check_switching_score_n = EMPTY_RULEBOOK; Array B355_carry_out_switching_sco --> SWITCH_SCORE_NOTIFY_ON_R NULL; ! 1 rule(s) Array B356_report_switching_score_ --> REP_SWITCH_NOTIFY_ON_R NULL; ! 1 rule(s) Constant B357_check_switching_score_n = EMPTY_RULEBOOK; Array B358_carry_out_switching_sco --> SWITCH_SCORE_NOTIFY_OFF_R NULL; ! 1 rule(s) Array B359_report_switching_score_ --> REP_SWITCH_NOTIFY_OFF_R NULL; ! 1 rule(s) Constant B360_check_requesting_the_pr = EMPTY_RULEBOOK; Array B361_carry_out_requesting_th --> ANNOUNCE_PRONOUN_MEANINGS_R NULL; ! 1 rule(s) Constant B362_report_requesting_the_p = EMPTY_RULEBOOK; Constant B363_check_finding_responses = EMPTY_RULEBOOK; Array B364_carry_out_finding_respo --> R_708 NULL; ! 1 rule(s) Constant B365_report_finding_response = EMPTY_RULEBOOK; Constant B366_check_giving_text_for = EMPTY_RULEBOOK; Array B367_carry_out_giving_text_f --> R_714 NULL; ! 1 rule(s) Constant B368_report_giving_text_for = EMPTY_RULEBOOK; Constant B369_check_giving_link_to = EMPTY_RULEBOOK; Array B370_carry_out_giving_link_t --> R_715 NULL; ! 1 rule(s) Constant B371_report_giving_link_to = EMPTY_RULEBOOK; Constant B372_check_preparing = EMPTY_RULEBOOK; Array B373_carry_out_preparing --> R_716 NULL; ! 1 rule(s) Constant B374_report_preparing = EMPTY_RULEBOOK; Constant B375_check_switching_the_num = EMPTY_RULEBOOK; Array B376_carry_out_switching_the --> R_807 NULL; ! 1 rule(s) Constant B377_report_switching_the_nu = EMPTY_RULEBOOK; Constant B378_check_switching_the_num = EMPTY_RULEBOOK; Array B379_carry_out_switching_the --> R_808 NULL; ! 1 rule(s) Constant B380_report_switching_the_nu = EMPTY_RULEBOOK; Array B381_reset_combat_variables --> R_839 NULL; ! 1 rule(s) Constant B382_whether_attacking_begin = EMPTY_RULEBOOK; Constant B383_preliminary_results_of_ = EMPTY_RULEBOOK; Array B384_basic_attack_roll --> R_840 NULL; ! 1 rule(s) Array B385_whether_attack_modifier --> R_841 NULL; ! 1 rule(s) Array B386_attack_modifiers --> R_842 R_862 R_875 R_922 R_970 NULL; ! 5 rule(s) Array B387_always_present_attack_m --> R_828 R_870 R_874 NULL; ! 3 rule(s) Array B388_show_results_of_the_att --> R_843 NULL; ! 1 rule(s) Array B389_whether_the_attack_hit --> R_844 NULL; ! 1 rule(s) Constant B390_immediate_results_of_hi = EMPTY_RULEBOOK; Array B391_basic_damage_roll --> R_845 NULL; ! 1 rule(s) Array B392_damage_modifiers --> R_829 R_863 R_971 NULL; ! 3 rule(s) Array B393_printing_the_damage --> R_847 NULL; ! 1 rule(s) Array B394_final_damage --> R_846 NULL; ! 1 rule(s) Array B395_report_no_final_damage --> R_848 NULL; ! 1 rule(s) Array B396_non_fatal_damage --> R_852 R_864 NULL; ! 2 rule(s) Array B397_fatal_damage --> R_853 NULL; ! 1 rule(s) Array B398_take_away_until_attack_ --> R_865 R_871 R_876 NULL; ! 3 rule(s) Array B399_print_flavour_text --> R_849 R_931 NULL; ! 2 rule(s) Array B400_aftereffects --> R_826 R_938 NULL; ! 2 rule(s) Array B401_final_blow_report --> R_850 NULL; ! 1 rule(s) Constant B402_check_concentrating = EMPTY_RULEBOOK; Array B403_carry_out_concentrating --> R_861 NULL; ! 1 rule(s) Constant B404_report_concentrating = EMPTY_RULEBOOK; Constant B405_check_parrying = EMPTY_RULEBOOK; Array B406_carry_out_parrying --> R_869 NULL; ! 1 rule(s) Constant B407_report_parrying = EMPTY_RULEBOOK; Constant B408_check_dodging = EMPTY_RULEBOOK; Array B409_carry_out_dodging --> R_873 NULL; ! 1 rule(s) Constant B410_report_dodging = EMPTY_RULEBOOK; Array B411_standard_ai_target_sele --> R_882 R_883 R_884 R_885 R_886 R_887 R_888 R_889 R_890 R_891 NULL; ! 10 rule(s) Array B412_standard_ai_weapon_sele --> R_893 R_894 R_895 R_896 R_897 R_898 R_899 R_900 R_901 R_944 R_945 NULL; ! 11 rule(s) Array B413_standard_ai_action_sele --> R_948 R_909 R_908 R_907 R_906 R_905 R_904 R_903 R_914 R_915 R_916 R_917 R_918 R_919 R_969 R_920 NULL; ! 16 rule(s) Array B414_chance_to_win --> R_910 R_868 R_872 R_877 R_911 R_912 R_923 R_913 NULL; ! 8 rule(s) Array B415_standard_attacker --> R_921 NULL; ! 1 rule(s) Constant B416_check_readying = EMPTY_RULEBOOK; Array B417_carry_out_readying --> R_924 NULL; ! 1 rule(s) Constant B418_report_readying = EMPTY_RULEBOOK; Constant B419_intervening_flavour_tex = EMPTY_RULEBOOK; Array B420_flavour --> R_932 NULL; ! 1 rule(s) Array B421_fatal_player_flavour --> R_933 NULL; ! 1 rule(s) Array B422_fatal_flavour --> R_934 NULL; ! 1 rule(s) Array B423_attack_move_flavour --> R_935 NULL; ! 1 rule(s) Array B424_check_reloading --> R_942 NULL; ! 1 rule(s) Array B425_carry_out_reloading --> R_943 NULL; ! 1 rule(s) Constant B426_report_reloading = EMPTY_RULEBOOK; Constant B427_check_charging = EMPTY_RULEBOOK; Array B428_carry_out_charging --> R_949 NULL; ! 1 rule(s) Constant B429_report_charging = EMPTY_RULEBOOK; Constant BR_0 = R_5; Constant BR_1 = R_6; Constant BR_2 = R_7; Constant BR_3 = R_8; Constant BR_4 = R_9; Constant BR_5 = R_10; Constant BR_6 = R_13; Constant BR_7 = R_14; Constant BR_8 = R_15; Constant BR_9 = R_16; Constant BR_10 = R_17; Constant BR_11 = R_18; Constant BR_12 = R_19; Constant BR_13 = R_20; Constant BR_14 = R_21; Constant BR_15 = R_22; Constant BR_16 = R_23; Constant BR_17 = R_24; Constant BR_18 = R_25; Constant BR_19 = R_26; Constant BR_20 = R_28; Constant BR_21 = R_29; Constant BR_22 = R_30; Constant BR_23 = R_31; Constant BR_24 = R_32; Constant BR_25 = R_33; Constant BR_26 = R_46; Constant BR_27 = R_47; Constant BR_28 = R_48; Constant BR_29 = R_49; Constant BR_30 = R_50; Constant BR_31 = R_51; Constant BR_32 = R_52; Constant BR_33 = R_53; Constant BR_34 = R_54; Constant BR_35 = R_55; Constant BR_36 = R_58; Constant BR_37 = R_59; Constant BR_38 = R_60; Constant BR_39 = R_61; Constant BR_40 = R_62; Constant BR_41 = R_63; Constant BR_42 = R_64; Constant BR_43 = R_65; Constant BR_44 = R_66; Constant BR_45 = R_67; Constant BR_46 = R_68; Constant BR_47 = R_70; Constant BR_48 = R_71; Constant BR_49 = R_72; Constant BR_50 = R_73; Constant BR_51 = R_74; Constant BR_52 = R_75; Constant BR_53 = R_76; Constant BR_54 = R_77; Constant BR_55 = R_78; Constant BR_56 = R_79; Constant BR_57 = R_80; Constant BR_58 = R_81; Constant BR_59 = R_82; Constant BR_60 = R_83; Constant BR_61 = R_84; Constant BR_62 = R_85; Constant BR_63 = R_86; Constant BR_64 = R_87; Constant BR_65 = R_88; Constant BR_66 = R_89; Constant BR_67 = R_90; Constant BR_68 = R_91; Constant BR_69 = R_92; Constant BR_70 = R_93; Constant BR_71 = R_94; Constant BR_72 = R_95; Constant BR_73 = R_96; Constant BR_74 = R_97; Constant BR_75 = R_98; Constant BR_76 = R_99; Constant BR_77 = R_100; Constant BR_78 = R_101; Constant BR_79 = R_102; Constant BR_80 = R_103; Constant BR_81 = R_104; Constant BR_82 = R_105; Constant BR_83 = R_106; Constant BR_84 = R_107; Constant BR_85 = R_108; Constant BR_86 = R_109; Constant BR_87 = R_110; Constant BR_88 = R_111; Constant BR_89 = R_112; Constant BR_90 = R_113; Constant BR_91 = R_114; Constant BR_92 = R_115; Constant BR_93 = R_116; Constant BR_94 = R_117; Constant BR_95 = R_118; Constant BR_96 = R_119; Constant BR_97 = R_120; Constant BR_98 = R_121; Constant BR_99 = R_122; Constant BR_100 = R_123; Constant BR_101 = R_124; Constant BR_102 = R_125; Constant BR_103 = R_126; Constant BR_104 = R_127; Constant BR_105 = R_128; Constant BR_106 = R_129; Constant BR_107 = R_130; Constant BR_108 = R_131; Constant BR_109 = R_132; Constant BR_110 = R_133; Constant BR_111 = R_134; Constant BR_112 = R_135; Constant BR_113 = R_136; Constant BR_114 = R_137; Constant BR_115 = R_138; Constant BR_116 = R_139; Constant BR_117 = R_140; Constant BR_118 = R_141; Constant BR_119 = R_142; Constant BR_120 = R_144; Constant BR_121 = R_145; Constant BR_122 = R_146; Constant BR_123 = R_147; Constant BR_124 = R_148; Constant BR_125 = R_149; Constant BR_126 = R_150; Constant BR_127 = R_151; Constant BR_128 = R_152; Constant BR_129 = R_153; Constant BR_130 = R_154; Constant BR_131 = R_155; Constant BR_132 = R_156; Constant BR_133 = R_157; Constant BR_134 = R_158; Constant BR_135 = R_159; Constant BR_136 = R_160; Constant BR_137 = R_161; Constant BR_138 = R_162; Constant BR_139 = R_163; Constant BR_140 = R_164; Constant BR_141 = R_165; Constant BR_142 = R_166; Constant BR_143 = R_167; Constant BR_144 = R_168; Constant BR_145 = R_169; Constant BR_146 = R_170; Constant BR_147 = R_171; Constant BR_148 = R_172; Constant BR_149 = R_173; Constant BR_150 = R_174; Constant BR_151 = R_175; Constant BR_152 = R_176; Constant BR_153 = R_177; Constant BR_154 = R_178; Constant BR_155 = R_179; Constant BR_156 = R_180; Constant BR_157 = R_181; Constant BR_158 = R_182; Constant BR_159 = R_183; Constant BR_160 = R_184; Constant BR_161 = R_185; Constant BR_162 = R_186; Constant BR_163 = R_187; Constant BR_164 = R_188; Constant BR_165 = R_189; Constant BR_166 = R_190; Constant BR_167 = R_191; Constant BR_168 = R_192; Constant BR_169 = R_193; Constant BR_170 = R_194; Constant BR_171 = R_195; Constant BR_172 = R_196; Constant BR_173 = R_197; Constant BR_174 = R_198; Constant BR_175 = R_199; Constant BR_176 = R_200; Constant BR_177 = R_201; Constant BR_178 = R_202; Constant BR_179 = R_203; Constant BR_180 = R_204; Constant BR_181 = R_205; Constant BR_182 = R_206; Constant BR_183 = R_207; Constant BR_184 = R_208; Constant BR_185 = R_209; Constant BR_186 = R_210; Constant BR_187 = R_211; Constant BR_188 = R_212; Constant BR_189 = R_213; Constant BR_190 = R_214; Constant BR_191 = R_215; Constant BR_192 = R_216; Constant BR_193 = R_217; Constant BR_194 = R_218; Constant BR_195 = R_219; Constant BR_196 = R_220; Constant BR_197 = R_221; Constant BR_198 = R_222; Constant BR_199 = R_223; Constant BR_200 = R_224; Constant BR_201 = R_225; Constant BR_202 = R_226; Constant BR_203 = R_227; Constant BR_204 = R_228; Constant BR_205 = R_229; Constant BR_206 = R_230; Constant BR_207 = R_231; Constant BR_208 = R_232; Constant BR_209 = R_233; Constant BR_210 = R_234; Constant BR_211 = R_235; Constant BR_212 = R_236; Constant BR_213 = R_237; Constant BR_214 = R_238; Constant BR_215 = R_239; Constant BR_216 = R_240; Constant BR_217 = R_241; Constant BR_218 = R_242; Constant BR_219 = R_243; Constant BR_220 = R_244; Constant BR_221 = R_245; Constant BR_222 = R_246; Constant BR_223 = R_247; Constant BR_224 = R_248; Constant BR_225 = R_249; Constant BR_226 = R_250; Constant BR_227 = R_251; Constant BR_228 = R_252; Constant BR_229 = R_253; Constant BR_230 = R_254; Constant BR_231 = R_255; Constant BR_232 = R_256; Constant BR_233 = R_257; Constant BR_234 = R_258; Constant BR_235 = R_259; Constant BR_236 = R_260; Constant BR_237 = R_261; Constant BR_238 = R_262; Constant BR_239 = R_263; Constant BR_240 = R_264; Constant BR_241 = R_265; Constant BR_242 = R_266; Constant BR_243 = R_267; Constant BR_244 = R_268; Constant BR_245 = R_269; Constant BR_246 = R_270; Constant BR_247 = R_271; Constant BR_248 = R_272; Constant BR_249 = R_273; Constant BR_250 = R_274; Constant BR_251 = R_275; Constant BR_252 = R_276; Constant BR_253 = R_277; Constant BR_254 = R_278; Constant BR_255 = R_279; Constant BR_256 = R_280; Constant BR_257 = R_281; Constant BR_258 = R_282; Constant BR_259 = R_826; Constant BR_260 = R_828; Constant BR_261 = R_829; Constant BR_262 = R_830; Constant BR_263 = R_831; Constant BR_264 = R_839; Constant BR_265 = R_840; Constant BR_266 = R_841; Constant BR_267 = R_842; Constant BR_268 = R_843; Constant BR_269 = R_844; Constant BR_270 = R_845; Constant BR_271 = R_846; Constant BR_272 = R_847; Constant BR_273 = R_848; Constant BR_274 = R_850; Constant BR_275 = R_852; Constant BR_276 = R_853; Constant BR_277 = R_855; Constant BR_278 = R_856; Constant BR_279 = R_857; Constant BR_280 = R_858; Constant BR_281 = R_862; Constant BR_282 = R_863; Constant BR_283 = R_864; Constant BR_284 = R_865; Constant BR_285 = R_868; Constant BR_286 = R_870; Constant BR_287 = R_871; Constant BR_288 = R_872; Constant BR_289 = R_874; Constant BR_290 = R_875; Constant BR_291 = R_876; Constant BR_292 = R_877; Constant BR_293 = R_882; Constant BR_294 = R_883; Constant BR_295 = R_884; Constant BR_296 = R_885; Constant BR_297 = R_886; Constant BR_298 = R_887; Constant BR_299 = R_888; Constant BR_300 = R_889; Constant BR_301 = R_890; Constant BR_302 = R_891; Constant BR_303 = R_893; Constant BR_304 = R_894; Constant BR_305 = R_895; Constant BR_306 = R_896; Constant BR_307 = R_897; Constant BR_308 = R_898; Constant BR_309 = R_899; Constant BR_310 = R_900; Constant BR_311 = R_901; Constant BR_312 = R_903; Constant BR_313 = R_904; Constant BR_314 = R_905; Constant BR_315 = R_906; Constant BR_316 = R_907; Constant BR_317 = R_908; Constant BR_318 = R_909; Constant BR_319 = R_910; Constant BR_320 = R_911; Constant BR_321 = R_912; Constant BR_322 = R_913; Constant BR_323 = R_914; Constant BR_324 = R_915; Constant BR_325 = R_916; Constant BR_326 = R_917; Constant BR_327 = R_918; Constant BR_328 = R_919; Constant BR_329 = R_920; Constant BR_330 = R_922; Constant BR_331 = R_923; Constant BR_332 = R_930; Constant BR_333 = R_932; Constant BR_334 = R_933; Constant BR_335 = R_934; Constant BR_336 = R_935; Constant BR_337 = R_938; Constant BR_338 = R_944; Constant BR_339 = R_945; Constant BR_340 = R_948; Constant BR_341 = R_969; Constant BR_342 = R_970; Constant BR_343 = R_971; Constant BR_902 = R_5; Constant BR_908 = R_6; Constant BR_909 = R_7; Constant BR_910 = R_8; Constant BR_911 = R_9; Constant BR_919 = R_13; Constant BR_920 = R_14; Constant BR_922 = R_15; Constant BR_925 = R_18; Constant BR_926 = R_16; Constant BR_927 = R_17; Constant BR_931 = R_19; Constant BR_935 = R_20; Constant BR_941 = R_32; Constant BR_943 = R_47; Constant BR_944 = R_48; Constant BR_946 = R_49; Constant BR_951 = R_54; Constant BR_952 = R_53; Constant BR_954 = R_55; Constant BR_955 = R_77; Constant BR_976 = R_930; [ DetectSceneChange chs sc ch ! Used for scene searches ; if (scene_status-->0 == 1) { if ((( (deadflag~=0) ))) { ch++; if (debug_scenes) print "[Scene 'Entire Game' ends]^"; if (PropertyKOV(KOVP_73, 0, 1)) scene_status-->0 = 0; else scene_status-->0 = 2; ProcessRulebook(26); scene_ended-->0 = the_time; scene_endings-->0 = (scene_endings-->0)|2; scene_latest_ending-->0 = 1; jump CScene; } } if (scene_status-->0 == 0) { if ((( (deadflag==0) ))) { ch++; if (debug_scenes) print "[Scene 'Entire Game' begins]^"; scene_status-->0 = 1; ProcessRulebook(25); scene_started-->0 = the_time; scene_endings-->0 = (scene_endings-->0)|1; scene_latest_ending-->0 = 0; jump CScene; } } .CScene; if (chs>10) ">--> The scene change machinery is stuck."; if (ch>0) DetectSceneChange(++chs); ]; [ PrintSceneName sc; switch (sc) { 1: print "Entire Game"; default: print ""; } ]; #IFDEF DEBUG; [ ShowSceneStatus chs sc ch; if (scene_status-->0 == 1) { print "Scene 'Entire Game' playing (for ", the_time-(scene_started-->0), " mins now)^"; } else { if (scene_latest_ending-->0 > 0) { print "Scene 'Entire Game' ended "; print "^"; } } ]; #ENDIF; Constant AD_ACTION = 0; ! The I6 action number (0 to 4095) Constant AD_REQUIREMENTS = 1; ! Such as requiring light; a bitmap, see below Constant AD_NOUN_KOV = 2; ! Kind of value of the first noun Constant AD_SECOND_KOV = 3; ! Kind of value of the second noun Constant AD_NAME_BASE = 4; ! Up to five words of a name, padded with nulls Constant AD_VARIABLES_CREATOR = 9; ! Routine to initialise variables owned Constant AD_VARIABLES_ID = 10; ! Frame ID for variables owned by action Constant AD_NAME_LENGTH = 5; Constant AD_RECORD_SIZE = 11; [ FindAction fa t; if (fa == -1) fa = action; t = 1; while (t <= ActionData-->0) { if (fa == ActionData-->t) return t; t = t + AD_RECORD_SIZE; } rfalse; ]; Constant TOUCH_NOUN_ABIT = $$00000001; Constant TOUCH_SECOND_ABIT = $$00000010; Constant LIGHT_ABIT = $$00000100; Constant NEED_NOUN_ABIT = $$00001000; Constant NEED_SECOND_ABIT = $$00010000; Constant OUT_OF_WORLD_ABIT = $$00100000; Constant CARRY_NOUN_ABIT = $$01000000; Constant CARRY_SECOND_ABIT = $$10000000; [ NeedToCarryNoun; return TestActionMask(CARRY_NOUN_ABIT); ]; [ NeedToCarrySecondNoun; return TestActionMask(CARRY_SECOND_ABIT); ]; [ NeedToTouchNoun; return TestActionMask(TOUCH_NOUN_ABIT); ]; [ NeedToTouchSecondNoun; return TestActionMask(TOUCH_SECOND_ABIT); ]; [ NeedLightForAction; return TestActionMask(LIGHT_ABIT); ]; [ TestActionMask match mask at; at = FindAction(-1); if (at == 0) rfalse; mask = ActionData-->(at+AD_REQUIREMENTS); if (mask & match) rtrue; rfalse; ]; [ TryAction req by ac n s stora tbits saved_command text_of_command; if (stora) return STORED_ACTION_TY_New(ac, n, s, by, req, stora); tbits = req & (16+32); req = req & 1; @push actor; @push act_requester; @push inp1; @push inp2; @push parsed_number; actor = by; if (req) act_requester = player; else act_requester = 0; by = FindAction(ac); if (by) { if (ActionData-->(by+AD_NOUN_KOV) == OBJECT_TY) inp1 = n; else { inp1 = 1; parsed_number = n; } if (ActionData-->(by+AD_SECOND_KOV) == OBJECT_TY) inp2 = s; else { inp2 = 1; parsed_number = s; } if (((ActionData-->(by+AD_NOUN_KOV) == UNDERSTANDING_TY) || (ActionData-->(by+AD_SECOND_KOV) == UNDERSTANDING_TY)) && (tbits)) { saved_command = INDEXED_TEXT_TY_Create(); INDEXED_TEXT_TY_Cast(players_command, SNIPPET_TY, saved_command); text_of_command = INDEXED_TEXT_TY_Create(); INDEXED_TEXT_TY_Cast(parsed_number, TEXT_TY, text_of_command); SetPlayersCommand(text_of_command); if (tbits == 16) { n = players_command; inp1 = 1; parsed_number = players_command; } else { s = players_command; inp2 = 1; parsed_number = players_command; } BlkFree(text_of_command); @push consult_from; @push consult_words; consult_from = 1; consult_words = parsed_number - 100; } } BeginAction(ac, n, s, 0, true); if (saved_command) { @pull consult_words; @pull consult_from; SetPlayersCommand(saved_command); BlkFree(saved_command); } @pull parsed_number; @pull inp2; @pull inp1; @pull act_requester; @pull actor; TrackActions(true); ]; [ R_Process a i j; @push inp1; @push inp2; inp1 = i; inp2 = j; BeginAction(a, i, j); @pull inp2; @pull inp1; ]; Global converted_action_outcome = -1; [ GVS_Convert ac n s; converted_action_outcome = BeginAction(ac, n, s); rtrue; ]; [ ConvertToGoingWithPush i oldrm newrm infl; i=noun; if (IndirectlyContains(noun, actor) == false) { move i to actor; infl = true; } move_pushing = i; oldrm = LocationOf(noun); BeginAction(##Go, second); newrm = LocationOf(actor); move_pushing = nothing; move i to newrm; if (newrm ~= oldrm) { if (IndirectlyContains(i, player)) TryAction(0, player, ##Look, 0, 0); RulebookSucceeds(); } else RulebookFails(); ]; [ ImplicitTake obj ks; if (actor == player) L__M(##Miscellany, 69, obj); else L__M(##Miscellany, 68, obj); ClearParagraphing(); @push keep_silent; keep_silent = true; if (act_requester) TryAction(true, actor, ##Take, obj, nothing); else TryAction(false, actor, ##Take, obj, nothing); @pull keep_silent; if (obj in actor) rtrue; rfalse; ]; [ LookAfterGoing; GoingLookBreak(); AbbreviatedRoomDescription(); ]; [ AbbreviatedRoomDescription prior_action pos frame_id; prior_action = action; action = ##Look; pos = FindAction(##Look); if ((pos) && (ActionData-->(pos+AD_VARIABLES_CREATOR))) { frame_id = ActionData-->(pos+AD_VARIABLES_ID); Mstack_Create_Frame(ActionData-->(pos+AD_VARIABLES_CREATOR), frame_id); ProcessRulebook(SETTING_ACTION_VARIABLES_RB); (MStack-->MstVO(frame_id, 0)) = prior_action; ! "room-describing action" (MStack-->MstVO(frame_id, 1)) = true; ! "abbreviated form allowed" } LookSub(); ! The I6 verb routine for "looking" if (frame_id) Mstack_Destroy_Frame(ActionData-->(pos+AD_VARIABLES_CREATOR), frame_id); action = prior_action; ]; [ BeginAction a n s moi notrack rv; ChronologyPoint(); @push action; @push noun; @push second; @push self; @push multiple_object_item; action = a; noun = n; second = s; self = noun; multiple_object_item = moi; if (action < 4096) rv = ActionPrimitive(); @pull multiple_object_item; @pull self; @pull second; @pull noun; @pull action; if (notrack == false) TrackActions(true); return rv; ]; [ ActionPrimitive rv p1 p2 p3 p4 p5 frame_id; MStack_CreateRBVars(ACTION_PROCESSING_RB); if ((keep_silent == false) && (multiflag == false)) DivideParagraphPoint(); reason_the_action_failed = 0; frame_id = -1; p1 = FindAction(action); if ((p1) && (ActionData-->(p1+AD_VARIABLES_CREATOR))) { frame_id = ActionData-->(p1+AD_VARIABLES_ID); Mstack_Create_Frame(ActionData-->(p1+AD_VARIABLES_CREATOR), frame_id); } if (ActionVariablesNotTypeSafe()) { if (frame_id ~= -1) Mstack_Destroy_Frame(ActionData-->(p1+AD_VARIABLES_CREATOR), frame_id); MStack_DestroyRBVars(ACTION_PROCESSING_RB); return; } ProcessRulebook(SETTING_ACTION_VARIABLES_RB); #IFDEF DEBUG; if ((trace_actions) && (FindAction(-1))) { print "["; p1=actor; p2=act_requester; p3=action; p4=noun; p5=second; DB_Action(p1,p2,p3,p4,p5); print "]^"; ClearParagraphing(); } ++debug_rule_nesting; #ENDIF; TrackActions(false); BeginFollowRulebook(); if ((meta) && (actor ~= player)) { L__M(##Miscellany, 74, actor); rv = RS_FAILS; } else if (meta) { DESCEND_TO_SPECIFIC_ACTION_R(); rv = RulebookOutcome(); } else { ProcessRulebook(ACTION_PROCESSING_RB); rv = RulebookOutcome(); } #IFDEF DEBUG; --debug_rule_nesting; if ((trace_actions) && (FindAction(-1))) { print "["; DB_Action(p1,p2,p3,p4,p5); print " - "; switch (rv) { RS_SUCCEEDS: print "succeeded"; RS_FAILS: print "failed"; #IFNDEF MEMORY_ECONOMY; if (reason_the_action_failed) print " the ", (RulePrintingRule) reason_the_action_failed; #ENDIF; default: print "ended without result"; } print "]^"; say__p = 1; SetRulebookOutcome(rv); ! In case disturbed by printing activities } #ENDIF; if (rv == RS_SUCCEEDS) UpdateActionBitmap(); EndFollowRulebook(); if (frame_id ~= -1) { p1 = FindAction(action); Mstack_Destroy_Frame(ActionData-->(p1+AD_VARIABLES_CREATOR), frame_id); } MStack_DestroyRBVars(ACTION_PROCESSING_RB); if ((keep_silent == false) && (multiflag == false)) DivideParagraphPoint(); if (rv == RS_SUCCEEDS) rtrue; rfalse; ]; [ ActionVariablesNotTypeSafe mask noun_kova second_kova at; at = FindAction(-1); if (at == 0) rfalse; ! For any I6-defined actions mask = ActionData-->(at+AD_REQUIREMENTS); if (mask & OUT_OF_WORLD_ABIT) { meta = 1; rfalse; } noun_kova = ActionData-->(at+AD_NOUN_KOV); second_kova = ActionData-->(at+AD_SECOND_KOV); !print "at = ", at, " nst = ", noun_kova, "^"; !print "consult_from = ", consult_from, " consult_words = ", consult_from, "^"; !print "inp1 = ", inp1, " noun = ", noun, "^"; !print "inp2 = ", inp2, " second = ", second, "^"; !print "sst = ", second_kova, "^"; if (noun_kova == 62 or 78) { if (inp1 ~= 1) { inp2 = inp1; second = noun; } parsed_number = 100*consult_from + consult_words; inp1 = 1; noun = parsed_number; } if (second_kova == 62 or 78) { parsed_number = 100*consult_from + consult_words; inp2 = 1; second = parsed_number; } if (inp1 == 1) { if (noun_kova == 64) { return L__M(##Miscellany, 61); } } else { if (noun_kova ~= 64) { return L__M(##Miscellany, 62); } if ((mask & NEED_NOUN_ABIT) && (noun == nothing)) { @push act_requester; act_requester = nothing; CarryOutActivity(SUPPLYING_A_MISSING_NOUN_ACT); @pull act_requester; if (noun == nothing) { if (say__p) rtrue; return L__M(##Miscellany, 59); } } if (((mask & NEED_NOUN_ABIT) == 0) && (noun ~= nothing)) { return L__M(##Miscellany, 60); } } if (inp2 == 1) { if (second_kova == 64) { return L__M(##Miscellany, 63); } } else { if (second_kova ~= 64) { return L__M(##Miscellany, 64); } if ((mask & NEED_SECOND_ABIT) && (second == nothing)) { @push act_requester; act_requester = nothing; CarryOutActivity(SUPPLYING_A_MISSING_SECOND_ACT); @pull act_requester; if (second == nothing) { if (say__p) rtrue; return L__M(##Miscellany, 65); } } if (((mask & NEED_SECOND_ABIT) == 0) && (second ~= nothing)) { return L__M(##Miscellany, 66); } } rfalse; ]; [ BASIC_VISIBILITY_R; if (act_requester) rfalse; if ((NeedLightForAction()) && (actor == player) && (ProcessRulebook(VISIBLE_RB)) && (RulebookSucceeded())) { BeginActivity(REFUSAL_TO_ACT_IN_DARK_ACT); if (ForActivity(REFUSAL_TO_ACT_IN_DARK_ACT)==false) L__M(##Miscellany, 17); EndActivity(REFUSAL_TO_ACT_IN_DARK_ACT); reason_the_action_failed = BASIC_VISIBILITY_R; RulebookFails(); rtrue; } rfalse; ]; [ BASIC_ACCESSIBILITY_R mask at; if (act_requester) rfalse; at = FindAction(-1); if (at == 0) rfalse; mask = ActionData-->(at+AD_REQUIREMENTS); if ((mask & TOUCH_NOUN_ABIT) && noun && (inp1 ~= 1)) { if (noun ofclass K3_direction) { RulebookFails(); reason_the_action_failed = BASIC_ACCESSIBILITY_R; if (actor~=player) rtrue; return L__M(##Miscellany, 67); } if (ObjectIsUntouchable(noun, (actor~=player), FALSE, actor)) { RulebookFails(); reason_the_action_failed = BASIC_ACCESSIBILITY_R; rtrue; } } if ((mask & TOUCH_SECOND_ABIT) && second && (inp2 ~= 1)) { if (second ofclass K3_direction) { RulebookFails(); reason_the_action_failed = BASIC_ACCESSIBILITY_R; if (actor~=player) rtrue; return L__M(##Miscellany, 67); } if (ObjectIsUntouchable(second, (actor~=player), FALSE, actor)) { RulebookFails(); reason_the_action_failed = BASIC_ACCESSIBILITY_R; rtrue; } } rfalse; ]; [ CARRYING_REQUIREMENTS_R mask at; at = FindAction(-1); if (at == 0) rfalse; mask = ActionData-->(at+AD_REQUIREMENTS); if ((mask & TOUCH_NOUN_ABIT) && noun && (inp1 ~= 1)) { if ((mask & CARRY_NOUN_ABIT) && (noun notin actor)) { BeginActivity(IMPLICITLY_TAKING_ACT, noun); if (ForActivity(IMPLICITLY_TAKING_ACT, noun)==false) ImplicitTake(noun); EndActivity(IMPLICITLY_TAKING_ACT, noun); !if (act_requester) rfalse; if (noun notin actor) { RulebookFails(); reason_the_action_failed = CARRYING_REQUIREMENTS_R; rtrue; } } } if ((mask & TOUCH_SECOND_ABIT) && second && (inp2 ~= 1)) { if ((mask & CARRY_SECOND_ABIT) && (second notin actor)) { BeginActivity(IMPLICITLY_TAKING_ACT, second); if (ForActivity(IMPLICITLY_TAKING_ACT, second)==false) ImplicitTake(second); EndActivity(IMPLICITLY_TAKING_ACT, second); !if (act_requester) rfalse; if (second notin actor) { RulebookFails(); reason_the_action_failed = CARRYING_REQUIREMENTS_R; rtrue; } } } rfalse; ]; [ REQUESTED_ACTIONS_REQUIRE_R; if ((actor ~= player) && (act_requester)) { @push say__p; say__p = 0; ProcessRulebook(PERSUADE_RB); if (RulebookSucceeded() == false) { if (say__p == FALSE) L__M(##Miscellany, 72, actor); RulebookFails(); rtrue; } @pull say__p; } rfalse; ]; [ CARRY_OUT_REQUESTED_ACTIONS_R rv; if ((actor ~= player) && (act_requester)) { @push act_requester; act_requester = nothing; rv = BeginAction(action, noun, second); if ((meta) || (rv == false)) { if (ProcessRulebook(UNSUCCESSFUL_ATTEMPT_RB) == false) L__M(##Miscellany, 58); } @pull act_requester; ActRulebookSucceeds(); rtrue; } rfalse; ]; Array Details_of_Specific_Action-->5; [ GenericVerbSub ch co re vis rv; @push converted_action_outcome; converted_action_outcome = -1; Details_of_Specific_Action-->0 = true; if (meta) Details_of_Specific_Action-->0 = false; Details_of_Specific_Action-->1 = keep_silent; Details_of_Specific_Action-->2 = ch; ! Check rules for the action Details_of_Specific_Action-->3 = co; ! Carry out rules for the action Details_of_Specific_Action-->4 = re; ! Report rules for the action ProcessRulebook(SPECIFIC_ACTION_PROCESSING_RB, 0, true); if ((RulebookFailed()) && (converted_action_outcome == 1)) ActRulebookSucceeds(); @pull converted_action_outcome; rtrue; ]; [ WORK_OUT_DETAILS_OF_SPECIFIC_R; MStack-->MstVO(SPECIFIC_ACTION_PROCESSING_RB, 0) = Details_of_Specific_Action-->0; MStack-->MstVO(SPECIFIC_ACTION_PROCESSING_RB, 1) = Details_of_Specific_Action-->1; MStack-->MstVO(SPECIFIC_ACTION_PROCESSING_RB, 2) = Details_of_Specific_Action-->2; MStack-->MstVO(SPECIFIC_ACTION_PROCESSING_RB, 3) = Details_of_Specific_Action-->3; MStack-->MstVO(SPECIFIC_ACTION_PROCESSING_RB, 4) = Details_of_Specific_Action-->4; rfalse; ]; [ TestActionBitmap obj act i j k bitmap; if (obj == nothing) bitmap = ActionHappened; else { if (~~(obj provides action_bitmap)) rfalse; bitmap = obj.&action_bitmap; } if (act == -1) return (((bitmap->0) & 1) ~= 0); for (i=0, k=2; ii) { return (((bitmap->j) & k) ~= 0); } k = k*2; if (k == 256) { k = 1; j++; } } rfalse; ]; [ UpdateActionBitmap; SetActionBitmap(noun, action); if (action == ##Go) SetActionBitmap(location, ##Enter); ]; [ SetActionBitmap obj act i j k bitmap; for (i=0, k=2; ii) { if (obj provides action_bitmap) { bitmap = obj.&action_bitmap; bitmap->0 = (bitmap->0) | 1; bitmap->j = (bitmap->j) | k; } ActionHappened->0 = (ActionHappened->0) | 1; ActionHappened->j = (ActionHappened->j) | k; } k = k*2; if (k == 256) { k = 1; j++; } } ]; [ SayActionName act; DB_Action(0, 0, act, 0, 0, 2); ]; [ DA_Name n; if (n ofclass K3_direction) print (name) n; else print (the) n; ]; [ DA_Topic x a b c d i cf cw; cw = x%100; cf = x/100; print "~"; for (a=cf:di; } if (d 0)) print "(", debug_rule_nesting, ") "; if ((ac ~= player) && (for_say ~= 2)) { if (acr) print "asking ", (the) ac, " to try "; else print (the) ac, " "; } t = FindAction(act); if (t) { t = t + AD_NAME_BASE; l = t + AD_NAME_LENGTH; while ((v = ActionData-->t) ~= NULL) { if (v ofclass Routine) { if (for_say == 2) { if (ActionData-->(t+1) ~= NULL) { if (clc++ > 0) print " "; print "it"; } } else { if (clc++ > 0) print " "; if (c==0) { (v)(n); } else { (v)(s); } c++; } } else { if (clc++ > 0) print " "; print (string) v; } t++; if (t == l) break; } if ((keep_silent) && (for_say == 0)) print " - silently"; } ]; Constant MAX_NESTED_ACTIVITIES = 20; Global activities_sp = 0; Array activities_stack --> MAX_NESTED_ACTIVITIES; Array activity_parameters_stack --> MAX_NESTED_ACTIVITIES; Global inhibit_flag = 0; Global saved_debug_rules = 0; [ FixInhibitFlag n act inhibit_rule_debugging; for (n=0:nn; if (act == PRINTING_THE_NAME_ACT or PRINTING_THE_PLURAL_NAME_ACT or PRINTING_ROOM_DESC_DETAILS_ACT or LISTING_CONTENTS_ACT or GROUPING_TOGETHER_ACT) inhibit_rule_debugging = true; } if ((inhibit_flag == false) && (inhibit_rule_debugging)) { saved_debug_rules = debug_rules; debug_rules = 0; } if ((inhibit_flag) && (inhibit_rule_debugging == false)) { debug_rules = saved_debug_rules; } inhibit_flag = inhibit_rule_debugging; ]; [ TestActivity A desc i; for (i=0:ii == A) { if (desc == 0) rtrue; if ((desc)(activity_parameters_stack-->i)) rtrue; } rfalse; ]; [ ActivityEmpty A x; x = Activity_before_rulebooks-->A; if (((rulebooks_array-->x)-->0) ~= NULL) rfalse; x = Activity_for_rulebooks-->A; if (((rulebooks_array-->x)-->0) ~= NULL) rfalse; x = Activity_after_rulebooks-->A; if (((rulebooks_array-->x)-->0) ~= NULL) rfalse; rtrue; ]; [ RulebookEmpty rb; if (((rulebooks_array-->rb)-->0) ~= NULL) rfalse; rtrue; ]; [ ProcessActivityRulebook rulebook parameter rv; @push self; if (parameter) self = parameter; rv = ProcessRulebook(rulebook, parameter, true); @pull self; if (rv) rtrue; rfalse; ]; [ CarryOutActivity A o rv; BeginActivity(A, o); rv = ForActivity(A, o); EndActivity(A, o); return rv; ]; [ BeginActivity A o x; if (activities_sp == MAX_NESTED_ACTIVITIES) return RunTimeProblem(RTP_TOOMANYACTS); activity_parameters_stack-->activities_sp = o; activities_stack-->(activities_sp++) = A; FixInhibitFlag(); MStack_CreateAVVars(A); if (Activity_atb_rulebooks->A) { x = action; action = action_to_be; } o = ProcessActivityRulebook(Activity_before_rulebooks-->A, o); if (Activity_atb_rulebooks->A) action = x; return o; ]; [ ForActivity A o x; if (Activity_atb_rulebooks->A) { x = action; action = action_to_be; } o = ProcessActivityRulebook(Activity_for_rulebooks-->A, o); if (Activity_atb_rulebooks->A) action = x; return o; ]; [ EndActivity A o rv x; if ((activities_sp > 0) && (activities_stack-->(activities_sp-1) == A)) { if (Activity_atb_rulebooks->A) { x = action; action = action_to_be; } rv = ProcessActivityRulebook(Activity_after_rulebooks-->A, o); if (Activity_atb_rulebooks->A) action = x; activities_sp--; FixInhibitFlag(); MStack_DestroyAVVars(A); return rv; } return RunTimeProblem(RTP_CANTABANDON); ]; [ AbandonActivity A o; if ((activities_sp > 0) && (activities_stack-->(activities_sp-1) == A)) { activities_sp--; FixInhibitFlag(); MStack_DestroyAVVars(A); return; } return RunTimeProblem(RTP_CANTEND); ]; Array ResourceUsageFlags -> (1+0+5); [ DisplayFigure resource_ID one_time; if ((one_time) && (ResourceUsageFlags->resource_ID)) return; ResourceUsageFlags->resource_ID = true; print "^"; VM_Picture(resource_ID); print "^"; ]; [ PlaySound resource_ID one_time; if (resource_ID == 0) return; ! The "silence" non-sound effect if ((one_time) && (ResourceUsageFlags->resource_ID)) return; ResourceUsageFlags->resource_ID = true; VM_SoundEffect(resource_ID); ]; Constant AUXF_MAGIC = 0; ! First word holds a safety constant Constant AUXF_MAGIC_VALUE = 16339; ! Should be first word of any valid file structure Constant AUXF_STATUS = 1; ! One of the following: Constant AUXF_STATUS_IS_UNUSED = 0; ! Never used Constant AUXF_STATUS_IS_CLOSED = 1; ! Currently closed Constant AUXF_STATUS_IS_OPEN_FOR_READ = 2; Constant AUXF_STATUS_IS_OPEN_FOR_WRITE = 3; Constant AUXF_STATUS_IS_OPEN_FOR_APPEND = 4; Constant AUXF_BINARY = 2; ! False for text files (I7 default), true for binary Constant AUXF_FREF = 3; ! Glulx file reference number (if file has been used) Constant AUXF_STREAM = 4; ! Stream for an open file (meaningless otherwise) Constant AUXF_FILENAME = 5; ! Packed address of constant string Constant AUXF_IFID_OF_OWNER = 6; ! UUID_ARRAY if owned by this project, or ! string array of IFID of owner wrapped in //...//, or NULL to leave open Array TableOfExternalFiles --> 0 0; [ PrintExternalFileName f; switch(f) { default: print ""; } ]; [ FileIO_Error auxf err_text; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) { print "^*** Error on unknown file: ", (string) err_text, " ***^"; } else print "^*** Error on file '", (string) auxf-->AUXF_FILENAME, "': ", (string) err_text, " ***^"; RunTimeProblem(RTP_FILEIOERROR); return 0; ]; #IFDEF TARGET_GLULX; [ FileIO_Fref auxf fref usage; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) rfalse; if (auxf-->AUXF_STATUS == 0) { if (auxf-->AUXF_BINARY) usage = fileusage_BinaryMode; else usage = fileusage_TextMode; auxf-->AUXF_FREF = glk_fileref_create_by_name(fileusage_Data + usage, Glulx_ChangeAnyToCString(auxf-->AUXF_FILENAME), 0); auxf-->AUXF_STATUS = AUXF_STATUS_IS_CLOSED; } return auxf-->AUXF_FREF; ]; [ FileIO_Exists auxf fref; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) rfalse; fref = FileIO_Fref(auxf); return glk_fileref_does_file_exist(fref); ]; [ FileIO_Ready auxf fref str ch; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) rfalse; fref = FileIO_Fref(auxf); if (glk_fileref_does_file_exist(fref) == false) rfalse; str = glk_stream_open_file(fref, filemode_Read, 0); ch = glk_get_char_stream(str); glk_stream_close(str, 0); if (ch ~= '*') rfalse; rtrue; ]; [ FileIO_MarkReady auxf readiness fref str ch; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to open a non-file"); fref = FileIO_Fref(auxf); if (auxf-->AUXF_STATUS ~= AUXF_STATUS_IS_CLOSED) return FileIO_Error(auxf, "only closed files can be marked"); str = glk_stream_open_file(fref, filemode_ReadWrite, 0); glk_stream_set_position(str, 0, 0); ! seek start if (readiness) ch = '*'; else ch = '-'; glk_put_char_stream(str, ch); ! mark as complete glk_stream_close(str, 0); ]; [ FileIO_Open auxf write_flag append_flag fref str mode ix ch not_this_ifid owner force_header; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to open a non-file"); fref = FileIO_Fref(auxf); if (auxf-->AUXF_STATUS ~= AUXF_STATUS_IS_CLOSED) return FileIO_Error(auxf, "tried to open a file already open"); if (write_flag) { if (append_flag) { mode = filemode_WriteAppend; if (glk_fileref_does_file_exist(fref) == false) force_header = true; } else mode = filemode_Write; } else { mode = filemode_Read; if (glk_fileref_does_file_exist(fref) == false) return FileIO_Error(auxf, "tried to open a file which does not exist"); } str = glk_stream_open_file(fref, mode, 0); if (str == 0) return FileIO_Error(auxf, "tried to open a file but failed"); auxf-->AUXF_STREAM = str; if (write_flag) { if (append_flag) auxf-->AUXF_STATUS = AUXF_STATUS_IS_OPEN_FOR_APPEND; else auxf-->AUXF_STATUS = AUXF_STATUS_IS_OPEN_FOR_WRITE; glk_stream_set_current(str); if ((append_flag == FALSE) || (force_header)) { print "- "; for (ix=6: ix <= UUID_ARRAY->0: ix++) print (char) UUID_ARRAY->ix; print " ", (string) auxf-->AUXF_FILENAME, "^"; } } else { auxf-->AUXF_STATUS = AUXF_STATUS_IS_OPEN_FOR_READ; ch = FileIO_GetC(auxf); if (ch ~= '-' or '*') { jump BadFile; } if (ch == '-') return FileIO_Error(auxf, "tried to open a file which was incomplete"); ch = FileIO_GetC(auxf); if (ch ~= ' ') { jump BadFile; } ch = FileIO_GetC(auxf); if (ch ~= '/') { jump BadFile; } ch = FileIO_GetC(auxf); if (ch ~= '/') { jump BadFile; } owner = auxf-->AUXF_IFID_OF_OWNER; ix = 3; if (owner == UUID_ARRAY) ix = 8; if (owner ~= NULL) { for (: ix <= owner->0: ix++) { ch = FileIO_GetC(auxf); if (ch == -1) { jump BadFile; } if (ch ~= owner->ix) not_this_ifid = true; if (ch == ' ') break; } if (not_this_ifid == false) { ch = FileIO_GetC(auxf); if (ch ~= ' ') { jump BadFile; } } } while (ch ~= -1) { ch = FileIO_GetC(auxf); if (ch == 10 or 13) break; } if (not_this_ifid) { auxf-->AUXF_STATUS = AUXF_STATUS_IS_CLOSED; glk_stream_close(str, 0); return FileIO_Error(auxf, "tried to open a file owned by another project"); } } return auxf-->AUXF_STREAM; .BadFile; auxf-->AUXF_STATUS = AUXF_STATUS_IS_CLOSED; glk_stream_close(str, 0); return FileIO_Error(auxf, "tried to open a file which seems to be malformed"); ]; [ FileIO_Close auxf; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to close a non-file"); if (auxf-->AUXF_STATUS ~= AUXF_STATUS_IS_OPEN_FOR_READ or AUXF_STATUS_IS_OPEN_FOR_WRITE or AUXF_STATUS_IS_OPEN_FOR_APPEND) return FileIO_Error(auxf, "tried to close a file which is not open"); if ((auxf-->AUXF_BINARY == false) && (auxf-->AUXF_STATUS == AUXF_STATUS_IS_OPEN_FOR_WRITE or AUXF_STATUS_IS_OPEN_FOR_APPEND)) { glk_set_window(gg_mainwin); } if (auxf-->AUXF_STATUS == AUXF_STATUS_IS_OPEN_FOR_WRITE or AUXF_STATUS_IS_OPEN_FOR_APPEND) { glk_stream_set_position(auxf-->AUXF_STREAM, 0, 0); ! seek start glk_put_char_stream(auxf-->AUXF_STREAM, '*'); ! mark as complete } glk_stream_close(auxf-->AUXF_STREAM, 0); auxf-->AUXF_STATUS = AUXF_STATUS_IS_CLOSED; ]; [ FileIO_GetC auxf; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return -1; if (auxf-->AUXF_STATUS ~= AUXF_STATUS_IS_OPEN_FOR_READ) return -1; return glk_get_char_stream(auxf-->AUXF_STREAM); ]; [ FileIO_PutC auxf char; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to write to a non-file"); if (auxf-->AUXF_STATUS ~= AUXF_STATUS_IS_OPEN_FOR_WRITE or AUXF_STATUS_IS_OPEN_FOR_APPEND) return FileIO_Error(auxf, "tried to write to a file which is not open for writing"); return glk_put_char_stream(auxf-->AUXF_STREAM, char); ]; [ FileIO_PrintLine auxf ch; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to write to a non-file"); for (::) { ch = FileIO_GetC(auxf); if (ch == -1) rfalse; if (ch == 10 or 13) { print "^"; rtrue; } print (char) ch; } ]; [ FileIO_PrintContents auxf tab; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to access a non-file"); if (auxf-->AUXF_BINARY) return FileIO_Error(auxf, "printing text will not work with binary files"); if (FileIO_Open(auxf, false) == 0) rfalse; while (FileIO_PrintLine(auxf)) ; FileIO_Close(auxf); rtrue; ]; [ FileIO_PutContents auxf text append_flag str ch; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to access a non-file"); if (auxf-->AUXF_BINARY) return FileIO_Error(auxf, "writing text will not work with binary files"); str = FileIO_Open(auxf, true, append_flag); if (str == 0) rfalse; @push say__p; @push say__pc; ClearParagraphing(); PrintText(text); FileIO_Close(auxf); @pull say__pc; @pull say__p; rfalse; ]; [ FileIO_PutTable auxf tab rv; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to write table to a non-file"); if (auxf-->AUXF_BINARY) return FileIO_Error(auxf, "writing a table will not work with binary files"); if (FileIO_Open(auxf, true) == 0) rfalse; rv = TablePrint(tab); FileIO_Close(auxf); if (rv) return RunTimeProblem(RTP_TABLE_CANTSAVE, tab); rtrue; ]; [ FileIO_GetTable auxf tab; if ((auxf == 0) || (auxf-->AUXF_MAGIC ~= AUXF_MAGIC_VALUE)) return FileIO_Error(auxf, "tried to read table from a non-file"); if (auxf-->AUXF_BINARY) return FileIO_Error(auxf, "reading a table will not work with binary files"); if (FileIO_Open(auxf, false) == 0) rfalse; TableRead(tab, auxf); FileIO_Close(auxf); rtrue; ]; #IFNOT; ! TARGET_GLULX [ FileIO_Exists auxf; rfalse; ]; [ FileIO_Ready auxf; rfalse; ]; [ FileIO_GetC auxf; return -1; ]; [ FileIO_PutTable auxf tab; return FileIO_Error(auxf, "external files can only be used under Glulx"); ]; [ FileIO_MarkReady auxf status; FileIO_PutTable(auxf); ]; [ FileIO_GetTable auxf tab; FileIO_PutTable(auxf); ]; [ FileIO_PrintContents auxf; FileIO_PutTable(auxf); ]; [ FileIO_PutContents auxf; FileIO_PutTable(auxf); ]; #ENDIF; ! TARGET_GLULX Constant MAX_MSTACK_FRAME = 2 + 6; Constant MSTACK_CAPACITY = 20; Constant MSTACK_SIZE = MSTACK_CAPACITY*MAX_MSTACK_FRAME; Array MStack --> MSTACK_SIZE; Global MStack_Top = 0; ! Topmost word currently used [ Mstack_Create_Frame creator id extent; if (creator == 0) rfalse; extent = creator.call(MStack_Top+2, 1); if (extent == 0) rfalse; if (MStack_Top + MAX_MSTACK_FRAME >= MSTACK_SIZE + 2) { RunTimeProblem(RTP_MSTACKMEMORY, MSTACK_SIZE); Mstack_Backtrace(); rfalse; } MStack_Top++; MStack-->MStack_Top = id; MStack_Top++; MStack_Top = MStack_Top + extent; MStack-->MStack_Top = -(extent+2); rtrue; ]; [ Mstack_Destroy_Frame creator id pos; pos = Mstack_Seek_Frame(id); if (pos == 0) rfalse; ! Not found: do nothing MStack_Top = pos - 2; ! Clear mstack down to just below this frame if (creator) creator.call(pos, -1); rtrue; ]; Global MStack_Frame_Extent = 0; [ Mstack_Seek_Frame id pos; pos = MStack_Top; while (MStack-->pos ~= 0) { MStack_Frame_Extent = MStack-->pos; pos = pos + MStack_Frame_Extent; MStack_Frame_Extent = (-2) - MStack_Frame_Extent; if (MStack-->(pos+1) == id) return pos+2; } MStack_Frame_Extent = 0; return 0; ! Not found ]; [ Mstack_Backtrace pos k; print "Mstack backtrace: size ", MStack_Top+1, " words^"; pos = MStack_Top; while (MStack-->pos ~= 0) { MStack_Frame_Extent = MStack-->pos; pos = pos + MStack_Frame_Extent; MStack_Frame_Extent = (-2) - MStack_Frame_Extent; print "Block at ", pos+2, " owner ID ", MStack-->(pos+1), " size ", MStack_Frame_Extent, "^"; for (k=0: k(pos+2+k), " "; print "^"; } ]; [ MstVO id off pos; pos = Mstack_Seek_Frame(id); if (pos == 0) { print "Variable unavailable: ", id, "/", off, "^"; rfalse; } if ((off<0) || (off >= MStack_Frame_Extent)) { print "Variable stack offset wrong: ", id, "/", off, " at ", pos, "^"; rfalse; } return pos+off; ]; [ MstVON id off pos; pos = Mstack_Seek_Frame(id); if (pos == 0) { return 0; ! word position 0 on the M-stack } if ((off<0) || (off >= MStack_Frame_Extent)) { print "Variable stack offset wrong: ", id, "/", off, " at ", pos, "^"; rfalse; } return pos+off; ]; Array rulebook_var_creators --> 0 0 0 0 0 0 0 0 RBSTVC_8 0 RBSTVC_10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; [ RBSTVC_8 pos state; if (state == 1) { MStack-->pos = selfobj ; pos++; } else { pos++; } return 1; ]; [ RBSTVC_10 pos state; if (state == 1) { MStack-->pos = false ; pos++; MStack-->pos = false ; pos++; MStack-->pos = 0 ; pos++; MStack-->pos = 0 ; pos++; MStack-->pos = 0 ; pos++; MStack-->pos = false ; pos++; } else { pos++; pos++; pos++; pos++; pos++; pos++; } return 6; ]; [ MStack_CreateRBVars rb cr; cr = rulebook_var_creators-->rb; if (cr == 0) return; Mstack_Create_Frame(cr, rb); ]; [ MStack_DestroyRBVars rb cr; cr = rulebook_var_creators-->rb; if (cr == 0) return; Mstack_Destroy_Frame(cr, rb); ]; Array activity_var_creators --> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; [ MStack_CreateAVVars av cr; cr = activity_var_creators-->av; if (cr == 0) return; Mstack_Create_Frame(cr, av + 10000); ]; [ MStack_DestroyAVVars av cr; cr = activity_var_creators-->av; if (cr == 0) return; Mstack_Destroy_Frame(cr, av + 10000); ]; [ Perform_Undo; #ifdef PREVENT_UNDO; L__M(##Miscellany, 70); return; #endif; if (turns == 1) { L__M(##Miscellany, 11); return; } if (undo_flag == 0) { L__M(##Miscellany, 6); return; } if (undo_flag == 1) { L__M(##Miscellany, 7); return; } if (VM_Undo() == 0) L__M(##Miscellany, 7); ]; [ ANNOUNCE_SCORE_R; if (actor ~= player) rfalse; #ifdef NO_SCORING; L__M(##Score, 2); #ifnot; GL__M(##Score); PrintRank(); #endif; ]; [ SWITCH_SCORE_NOTIFY_ON_R; if (actor ~= player) rfalse; #ifdef NO_SCORING; ANNOUNCE_SCORE_R(); #ifnot; notify_mode=1; #endif; ]; [ REP_SWITCH_NOTIFY_ON_R; if (actor ~= player) rfalse; #ifndef NO_SCORING; GL__M(##NotifyOn); #endif; ]; [ SWITCH_SCORE_NOTIFY_OFF_R; if (actor ~= player) rfalse; #ifdef NO_SCORING; ANNOUNCE_SCORE_R(); #ifnot; notify_mode=0; #endif; ]; [ REP_SWITCH_NOTIFY_OFF_R; if (actor ~= player) rfalse; #ifndef NO_SCORING; GL__M(##NotifyOff); #endif; ]; [ PREFER_SOMETIMES_ABBREVIATED_R; if (actor ~= player) rfalse; lookmode=1; ]; ! Brief [ REP_PREFER_SOMETIMES_ABBR_R; if (actor ~= player) rfalse; print (string) Story; GL__M(##LMode1); ]; ! Brief [ PREFER_UNABBREVIATED_R; if (actor ~= player) rfalse; lookmode=2; ]; ! Verbose [ REP_PREFER_UNABBREVIATED_R; if (actor ~= player) rfalse; print (string) Story; GL__M(##LMode2); ]; ! Verbose [ PREFER_ABBREVIATED_R; if (actor ~= player) rfalse; lookmode=3; ]; ! Superbrief [ REP_PREFER_ABBREVIATED_R; if (actor ~= player) rfalse; print (string) Story; GL__M(##LMode3); ]; ! Superbrief [ ANNOUNCE_PRONOUN_MEANINGS_R x y c d; if (actor ~= player) rfalse; GL__M(##Pronouns, 1); c = (LanguagePronouns-->0)/3; if (player ~= selfobj) c++; if (c==0) return GL__M(##Pronouns, 4); for (x = 1, d = 0 : x <= LanguagePronouns-->0: x = x+3) { print "~", (address) LanguagePronouns-->x, "~ "; y = LanguagePronouns-->(x+2); if (y == NULL) GL__M(##Pronouns, 3); else { GL__M(##Pronouns, 2); print (the) y; } d++; if (d < c-1) print ", "; if (d == c-1) print (string) LISTAND__TX; } if (player ~= selfobj) { print "~", (address) ME1__WD, "~ "; GL__M(##Pronouns, 2); c = player; player = selfobj; print (the) c; player = c; } "."; ]; !Constant TRACE_I7_SPACING; [ ClearParagraphing; say__p = 0; say__pc = 0; ]; [ DivideParagraphPoint; #ifdef TRACE_I7_SPACING; print "[DPP", say__p, say__pc, "]"; #endif; if (say__p) { new_line; say__p = 0; say__pc = say__pc | PARA_COMPLETED; if (say__pc & PARA_PROMPTSKIP) say__pc = say__pc - PARA_PROMPTSKIP; if (say__pc & PARA_SUPPRESSPROMPTSKIP) say__pc = say__pc - PARA_SUPPRESSPROMPTSKIP; } #ifdef TRACE_I7_SPACING; print "[-->", say__p, say__pc, "]"; #endif; say__pc = say__pc | PARA_CONTENTEXPECTED; ]; [ ParaContent; if (say__pc & PARA_CONTENTEXPECTED) { say__pc = say__pc - PARA_CONTENTEXPECTED; say__p = 1; } ]; [ GoingLookBreak; if (say__pc & PARA_COMPLETED == 0) new_line; ClearParagraphing(); ]; [ CommandClarificationBreak; new_line; ClearParagraphing(); ]; [ RunParagraphOn; #ifdef TRACE_I7_SPACING; print "[RPO", say__p, say__pc, "]"; #endif; say__p = 0; say__pc = say__pc | PARA_PROMPTSKIP; say__pc = say__pc | PARA_SUPPRESSPROMPTSKIP; ]; [ SpecialLookSpacingBreak; #ifdef TRACE_I7_SPACING; print "[SLS", say__p, say__pc, "]"; #endif; say__p = 0; say__pc = say__pc | PARA_PROMPTSKIP; ]; [ EnsureBreakBeforePrompt; if ((say__p) || ((say__pc & PARA_PROMPTSKIP) && ((say__pc & PARA_SUPPRESSPROMPTSKIP)==0))) new_line; ClearParagraphing(); ]; [ PrintSingleParagraph matter; say__p = 1; say__pc = say__pc | PARA_NORULEBOOKBREAKS; PrintText(matter); DivideParagraphPoint(); say__pc = 0; ]; [ STextSubstitution; if (say__n ~= 1) print "s"; ]; [ PrintPrompt i; style roman; EnsureBreakBeforePrompt(); PrintText( (Global_Vars-->22) ); ClearBoxedText(); ClearParagraphing(); enable_rte = true; ]; Global pending_boxed_quotation; ! a routine to overlay the quotation on screen [ DisplayBoxedQuotation Q; pending_boxed_quotation = Q; ]; [ ClearBoxedText i; if (pending_boxed_quotation) { for (i=0: Runtime_Quotations_Displayed-->i: i++) if (Runtime_Quotations_Displayed-->i == pending_boxed_quotation) { pending_boxed_quotation = 0; return; } Runtime_Quotations_Displayed-->i = pending_boxed_quotation; ClearParagraphing(); pending_boxed_quotation(); ClearParagraphing(); pending_boxed_quotation = 0; } ]; [ NotifyTheScore; #Ifndef NO_SCORING; if (notify_mode == 1) { DivideParagraphPoint(); VM_Style(NOTE_VMSTY); print "["; L__M(##Miscellany, 50, score-last_score); print ".]^"; VM_Style(NORMAL_VMSTY); } #Endif; ]; #Ifdef TARGET_ZCODE; #Iftrue (#version_number == 6); [ DrawStatusLine; Z6_DrawStatusLine(); ]; #Endif; #Endif; #Ifndef DrawStatusLine; [ DrawStatusLine width posb; @push say__p; @push say__pc; BeginActivity(CONSTRUCTING_STATUS_LINE_ACT); VM_StatusLineHeight(1); VM_MoveCursorInStatusLine(1, 1); if (statuswin_current) { width = VM_ScreenWidth(); posb = width-15; spaces width; ClearParagraphing(); if (ForActivity(CONSTRUCTING_STATUS_LINE_ACT) == false) { VM_MoveCursorInStatusLine(1, 2); switch(metaclass(left_hand_status_line)) { String: print (string) left_hand_status_line; Routine: left_hand_status_line(); } VM_MoveCursorInStatusLine(1, posb); switch(metaclass(right_hand_status_line)) { String: print (string) right_hand_status_line; Routine: right_hand_status_line(); } } VM_MoveCursorInStatusLine(1, 1); VM_MainWindow(); } ClearParagraphing(); EndActivity(CONSTRUCTING_STATUS_LINE_ACT); @pull say__pc; @pull say__p; ]; #Endif; [ SL_Score_Moves; if (not_yet_in_play) return; #ifdef NO_SCORING; print sline2; #ifnot; print sline1, "/", sline2; #endif; ]; [ SL_Location; if (not_yet_in_play) return; if (location == thedark) { BeginActivity(PRINTING_NAME_OF_DARK_ROOM_ACT); if (ForActivity(PRINTING_NAME_OF_DARK_ROOM_ACT) == false) L__M(##Miscellany, 71); EndActivity(PRINTING_NAME_OF_DARK_ROOM_ACT); } else { FindVisibilityLevels(); if (visibility_ceiling == location) print (name) location; else print (The) visibility_ceiling; } ]; [ Banner; BeginActivity(PRINTING_BANNER_TEXT_ACT); if (ForActivity(PRINTING_BANNER_TEXT_ACT) == false) { VM_Style(HEADER_VMSTY); print (string) Story; VM_Style(NORMAL_VMSTY); new_line; print (string) Headline; #ifdef Story_Author; print " by ", (string) Story_Author; #endif; ! Story_Author new_line; VM_Describe_Release(); print " / Inform 7 build ", (string) NI_BUILD_COUNT, " "; print "(I6/v"; inversion; print " lib ", (string) LibRelease, ") "; #Ifdef STRICT_MODE; print "S"; #Endif; ! STRICT_MODE #Ifdef DEBUG; print "D"; #Endif; ! DEBUG new_line; } EndActivity(PRINTING_BANNER_TEXT_ACT); ]; [ DecimalNumber num; print num; ]; [ EnglishNumber n; LanguageNumber(n); ]; [ PrintText x; if (x ofclass String) print (string) x; if (x ofclass Routine) (x)(); ]; [ I7_String x; PrintText(x); ]; ! An alternative name now used only by extensions [ PrintOrRun obj prop no_break routine_return_value; !print "(", obj, ".", prop, ";", say__p, say__pc, ")"; if (prop == 0) { print (name) prop; routine_return_value = true; } else { switch (metaclass(obj.prop)) { nothing: routine_return_value = false; String: print (string) obj.prop; !if (no_break == false) new_line; routine_return_value = true; Routine: routine_return_value = RunRoutines(obj, prop); !print "[", routine_return_value, "]"; } } if (routine_return_value) { say__p = 1; if (no_break == false) { new_line; !print "(DP->", say__p, say__pc, ")"; DivideParagraphPoint(); !print "(to", say__p, say__pc, ")"; } } !print "(-->", say__p, say__pc, ")"; return routine_return_value; ]; Array StorageForShortName buffer 250; [ CPrintOrRun obj prop v length i; if ((obj ofclass String or Routine) || (prop == 0)) VM_PrintToBuffer (StorageForShortName, 160, obj); else { if (obj.prop == NULL) rfalse; if (metaclass(obj.prop) == Routine or String) VM_PrintToBuffer(StorageForShortName, 160, obj, prop); else return RunTimeError(2, obj, prop); } length = StorageForShortName-->0; StorageForShortName->WORDSIZE = VM_LowerToUpperCase(StorageForShortName->WORDSIZE); for (i=WORDSIZE: ii; if (i>WORDSIZE) say__p = 1; return; ]; [ Cap str nocaps; if (nocaps) print (string) str; else CPrintOrRun(str, 0); ]; [ PSN__ o; if (o == 0) { print (string) NOTHING__TX; rtrue; } switch (metaclass(o)) { Routine: print ""; rtrue; String: print ""; rtrue; nothing: print ""; rtrue; } CarryOutActivity(PRINTING_THE_NAME_ACT, o); ]; Global caps_mode = false; [ STANDARD_NAME_PRINTING_R obj; obj = parameter_object; if (obj == 0) { print (string) NOTHING__TX; return; } switch (metaclass(obj)) { Routine: print ""; return; String: print ""; return; nothing: print ""; return; } if (obj == player) { if (indef_mode == NULL && caps_mode) print (string) YOU__TX; else print (string) YOURSELF__TX; return; } #Ifdef LanguagePrintShortName; if (LanguagePrintShortName(obj)) return; #Endif; ! LanguagePrintShortName if (indef_mode && obj.&short_name_indef ~= 0 && PrintOrRun(obj, short_name_indef, true) ~= 0) return; if (caps_mode && obj.&cap_short_name ~= 0 && PrintOrRun(obj, cap_short_name, true) ~= 0) { caps_mode = false; return; } if (obj.&short_name ~= 0 && PrintOrRun(obj, short_name, true) ~= 0) return; print (object) obj; ]; Global short_name_case; [ PrefaceByArticle obj acode pluralise capitalise i artform findout artval; if (obj provides articles) { artval=(obj.&articles)-->(acode+short_name_case*LanguageCases); if (capitalise) print (Cap) artval, " "; else print (string) artval, " "; if (pluralise) return; print (PSN__) obj; return; } i = GetGNAOfObject(obj); if (pluralise) { if (i < 3 || (i >= 6 && i < 9)) i = i + 3; } i = LanguageGNAsToArticles-->i; artform = LanguageArticles + 3*WORDSIZE*LanguageContractionForms*(short_name_case + i*LanguageCases); #Iftrue (LanguageContractionForms == 2); if (artform-->acode ~= artform-->(acode+3)) findout = true; #Endif; ! LanguageContractionForms #Iftrue (LanguageContractionForms == 3); if (artform-->acode ~= artform-->(acode+3)) findout = true; if (artform-->(acode+3) ~= artform-->(acode+6)) findout = true; #Endif; ! LanguageContractionForms #Iftrue (LanguageContractionForms == 4); if (artform-->acode ~= artform-->(acode+3)) findout = true; if (artform-->(acode+3) ~= artform-->(acode+6)) findout = true; if (artform-->(acode+6) ~= artform-->(acode+9)) findout = true; #Endif; ! LanguageContractionForms #Iftrue (LanguageContractionForms > 4); findout = true; #Endif; ! LanguageContractionForms #Ifdef TARGET_ZCODE; if (standard_interpreter ~= 0 && findout) { StorageForShortName-->0 = 160; @output_stream 3 StorageForShortName; if (pluralise) print (number) pluralise; else print (PSN__) obj; @output_stream -3; acode = acode + 3*LanguageContraction(StorageForShortName + 2); } #Ifnot; ! TARGET_GLULX if (findout) { if (pluralise) Glulx_PrintAnyToArray(StorageForShortName, 160, EnglishNumber, pluralise); else Glulx_PrintAnyToArray(StorageForShortName, 160, PSN__, obj); acode = acode + 3*LanguageContraction(StorageForShortName); } #Endif; ! TARGET_ Cap (artform-->acode, ~~capitalise); ! print article if (pluralise) return; print (PSN__) obj; ]; [ IndefArt obj i; if (obj == 0) { print (string) NOTHING__TX; rtrue; } i = indef_mode; indef_mode = true; if (obj has proper) { indef_mode = NULL; print (PSN__) obj; indef_mode = i; return; } if (obj provides article) { PrintOrRun(obj, article, true); print " ", (PSN__) obj; indef_mode = i; return; } PrefaceByArticle(obj, 2); indef_mode = i; ]; [ CIndefArt obj i; if (obj == 0) { CPrintOrRun(NOTHING__TX, 0); rtrue; } i = indef_mode; indef_mode = true; if (obj has proper) { indef_mode = NULL; caps_mode = true; print (PSN__) obj; indef_mode = i; caps_mode = false; return; } if (obj provides article) { CPrintOrRun(obj, article); print " ", (PSN__) obj; indef_mode = i; return; } PrefaceByArticle(obj, 2, 0, 1); indef_mode = i; ]; [ DefArt obj i; i = indef_mode; indef_mode = false; if ((~~obj ofclass Object) || obj has proper) { indef_mode = NULL; print (PSN__) obj; indef_mode = i; return; } PrefaceByArticle(obj, 1); indef_mode = i; ]; [ CDefArt obj i; i = indef_mode; indef_mode = false; if ((obj ofclass Object) && (obj has proper || obj == player)) { indef_mode = NULL; caps_mode = true; print (PSN__) obj; indef_mode = i; caps_mode = false; return; } if ((~~obj ofclass Object) || obj has proper) { indef_mode = NULL; print (PSN__) obj; indef_mode = i; return; } PrefaceByArticle(obj, 0); indef_mode = i; ]; [ PrintShortName obj i; i = indef_mode; indef_mode = NULL; PSN__(obj); indef_mode = i; ]; [ I7_SOO_PAR oldval count; if (count <= 1) return count; return random(count); ]; [ I7_SOO_RAN oldval count v; if (count <= 1) return count; v = oldval; while (v == oldval) v = random(count); return v; ]; [ I7_SOO_STI oldval count v; if (oldval) return oldval; return I7_SOO_PAR(oldval, count); ]; [ I7_SOO_CYC oldval count; oldval++; if (oldval > count) oldval = 1; return oldval; ]; [ I7_SOO_STOP oldval count; oldval++; if (oldval > count) oldval = count; return oldval; ]; [ I7_SOO_TAP oldval count tn rn c; if (count <= 1) return count; tn = count*(count+1)/2; rn = random(tn); for (c=1:c<=count:c++) { rn = rn - c; if (rn<=0) return (count-c+1); } ]; Array I7_SOO_SHUF->32; [ I7_SOO_SHU oldval count sd ct v i j s ssd scope cc base; base = count+1; v = oldval%base; oldval = oldval/base; ct = oldval%base; sd = oldval/base; if (count > 32) return I7_SOO_PAR(oldval, count); if (count <= 1) v = count; else { !print "^In v=", v, " ct=", ct, " sd=", sd, "^"; cc = base*base; scope = MAX_POSITIVE_NUMBER/cc - cc - base; if (scope%2==0) scope--; if (scope<0) scope = -scope; !print "Scope = ", scope, "^"; if (sd == 0) { sd = random(scope); ct=0; } for (i=0:ii = i; ssd = sd; for (i=0:ij; I7_SOO_SHUF->j = I7_SOO_SHUF->i; I7_SOO_SHUF->i = s; } !for (i=0:ii, " "; print "^"; v = (I7_SOO_SHUF->ct)+1; ct++; if (ct >= count) { ct = 0; ssd = 0; } } !print "Out v=", v, " ct=", ct, " ssd=", sd, "^"; !print "Return ", v + ct*base + ssd*base*base, "^"; return v + ct*base + ssd*base*base; ]; [ Relation_Now1to1 obj1 relation_property obj2 ol; ! Assert 1-1 true if (obj2) objectloop (ol provides relation_property) if (ol.relation_property == obj2) ol.relation_property = nothing; if (obj1) obj1.relation_property = obj2; ]; [ Relation_NowN1toV obj1 relation_property obj2; ! Assert 1-1 false if ((obj1) && (obj1.relation_property == obj2)) obj1.relation_property = nothing; ]; [ Relation_NowS1to1 obj1 relation_property obj2 ol; ! Assert symmetric 1-1 true if ((obj1 ofclass Object) && (obj1 provides relation_property) && (obj2 ofclass Object) && (obj2 provides relation_property)) { if (obj1.relation_property) { (obj1.relation_property).relation_property = 0; } if (obj2.relation_property) { (obj2.relation_property).relation_property = 0; } obj1.relation_property = obj2; obj2.relation_property = obj1; } ]; [ Relation_NowSN1to1 obj1 relation_property obj2 ol; ! Assert symmetric 1-1 false if ((obj1 ofclass Object) && (obj1 provides relation_property) && (obj2 ofclass Object) && (obj2 provides relation_property) && (obj1.relation_property == obj2)) { obj1.relation_property = 0; obj2.relation_property = 0; } ]; Constant VTOVS_LEFT_INDEX_PROP = 0; Constant VTOVS_RIGHT_INDEX_PROP = 1; Constant VTOVS_LEFT_DOMAIN_SIZE = 2; Constant VTOVS_RIGHT_DOMAIN_SIZE = 3; Constant VTOVS_LEFT_PRINTING_ROUTINE = 4; Constant VTOVS_RIGHT_PRINTING_ROUTINE = 5; Constant VTOVS_CACHE_BROKEN = 6; Constant VTOVS_CACHE = 7; [ Relation_NowVtoV obj1 vtov_structure obj2 sym pr pr2 i1 i2; if (sym && (obj2 ~= obj1)) { Relation_NowVtoV(obj2, vtov_structure, obj1, false); } pr = vtov_structure-->VTOVS_LEFT_INDEX_PROP; pr2 = vtov_structure-->VTOVS_RIGHT_INDEX_PROP; vtov_structure-->VTOVS_CACHE_BROKEN = true; ! Mark any cache as broken if (pr) { if ((obj1 ofclass Object) && (obj1 provides pr)) i1 = obj1.pr; else return RunTimeProblem(RTP_IMPREL, obj1, vtov_structure); } else i1 = obj1-1; if (pr2) { if ((obj2 ofclass Object) && (obj2 provides pr2)) i2 = obj2.pr2; else return RunTimeProblem(RTP_IMPREL, obj2, vtov_structure); } else i2 = obj2-1; pr = i1*(vtov_structure-->VTOVS_RIGHT_DOMAIN_SIZE) + i2; i1 = IncreasingPowersOfTwo_TB-->(pr%16); pr = pr/16 + 8; vtov_structure-->pr = (vtov_structure-->pr) | i1; ]; [ Relation_NowNVtoV obj1 vtov_structure obj2 sym pr pr2 i1 i2; if (sym && (obj2 ~= obj1)) { Relation_NowNVtoV(obj2, vtov_structure, obj1, false); } pr = vtov_structure-->VTOVS_LEFT_INDEX_PROP; pr2 = vtov_structure-->VTOVS_RIGHT_INDEX_PROP; vtov_structure-->VTOVS_CACHE_BROKEN = true; ! Mark any cache as broken if (pr) { if ((obj1 ofclass Object) && (obj1 provides pr)) i1 = obj1.pr; else return RunTimeProblem(RTP_IMPREL, obj1, vtov_structure); } else i1 = obj1-1; if (pr2) { if ((obj2 ofclass Object) && (obj2 provides pr2)) i2 = obj2.pr2; else return RunTimeProblem(RTP_IMPREL, obj2, vtov_structure); } else i2 = obj2-1; pr = i1*(vtov_structure-->VTOVS_RIGHT_DOMAIN_SIZE) + i2; i1 = IncreasingPowersOfTwo_TB-->(pr%16); pr = pr/16 + 8; if ((vtov_structure-->pr) & i1) vtov_structure-->pr = vtov_structure-->pr - i1; ]; [ Relation_TestVtoV obj1 vtov_structure obj2 sym pr pr2 i1 i2; pr = vtov_structure-->VTOVS_LEFT_INDEX_PROP; pr2 = vtov_structure-->VTOVS_RIGHT_INDEX_PROP; if (sym && (obj2 > obj1)) { sym = obj1; obj1 = obj2; obj2 = sym; } if (pr) { if ((obj1 ofclass Object) && (obj1 provides pr)) i1 = obj1.pr; else { RunTimeProblem(RTP_IMPREL, obj1, vtov_structure); rfalse; } } else i1 = obj1-1; if (pr2) { if ((obj2 ofclass Object) && (obj2 provides pr2)) i2 = obj2.pr2; else { RunTimeProblem(RTP_IMPREL, obj2, vtov_structure); rfalse; } } else i2 = obj2-1; pr = i1*(vtov_structure-->VTOVS_RIGHT_DOMAIN_SIZE) + i2; i1 = IncreasingPowersOfTwo_TB-->(pr%16); pr = pr/16 + 8; if ((vtov_structure-->pr) & i1) rtrue; rfalse; ]; [ Relation_NowEquiv obj1 relation_property obj2 big little; big = obj1.relation_property; little = obj2.relation_property; if (big == little) return; if (big < little) { little = obj1.relation_property; big = obj2.relation_property; } objectloop (obj1 provides relation_property) if (obj1.relation_property == big) obj1.relation_property = little; ]; [ Relation_NowNEquiv obj1 relation_property obj2 old new; old = obj1.relation_property; new = obj2.relation_property; if (old ~= new) return; new = 0; objectloop (obj2 provides relation_property) if (obj2.relation_property > new) new = obj2.relation_property; new++; obj1.relation_property = new; ]; [ Relation_ShowR rel_num rel_type x; x = rel_num*3; rel_type = relation_metadata-->(x+1); switch(rel_type) { Relation_Implicit: return 0; Relation_OtoO: Relation_RShowOtoO(relation_metadata-->x, false, x); Relation_OtoV: Relation_RShowOtoO(relation_metadata-->x, false, x); Relation_VtoO: Relation_ShowOtoO(relation_metadata-->x, false, x); Relation_VtoV: Relation_ShowVtoV(relation_metadata-->x, false, x); Relation_Sym_OtoO: Relation_ShowOtoO(relation_metadata-->x, true, x); Relation_Sym_VtoV: Relation_ShowVtoV(relation_metadata-->x, true, x); Relation_Equiv: Relation_ShowRHeader(x); Relation_ShowEquiv(relation_metadata-->x); Relation_ByRoutine: Relation_ShowRHeader(x); } return 1; ]; [ Relation_ShowRHeader x rel_type; rel_type = relation_metadata-->(x+1); print (string) relation_metadata-->(x+2); if (rel_type == Relation_ByRoutine) "."; print ":^"; ]; [ Relation_ShowVtoV vtov_structure sym x obj1 obj2 pr pr2 proutine1 proutine2; pr = vtov_structure-->VTOVS_LEFT_INDEX_PROP; pr2 = vtov_structure-->VTOVS_RIGHT_INDEX_PROP; proutine1 = vtov_structure-->VTOVS_LEFT_PRINTING_ROUTINE; proutine2 = vtov_structure-->VTOVS_RIGHT_PRINTING_ROUTINE; if (pr && pr2) { objectloop (obj1 provides pr) objectloop (obj2 provides pr2) { if (sym && obj2 > obj1) continue; if (Relation_TestVtoV(obj1, vtov_structure, obj2)) { if (x) { Relation_ShowRHeader(x); x=0; } print " ", (The) obj1; if (sym) print " <=> "; else print " >=> "; print (the) obj2, "^"; } } return; } if (pr && (pr2==0)) { objectloop (obj1 provides pr) for (obj2=1:obj2<=vtov_structure-->VTOVS_RIGHT_DOMAIN_SIZE:obj2++) { if (Relation_TestVtoV(obj1, vtov_structure, obj2)) { if (x) { Relation_ShowRHeader(x); x=0; } print " ", (The) obj1, " >=> "; (proutine2).call(obj2); print "^"; } } return; } if ((pr==0) && (pr2)) { for (obj1=1:obj1<=vtov_structure-->2:obj1++) objectloop (obj2 provides pr2) { if (Relation_TestVtoV(obj1, vtov_structure, obj2)) { if (x) { Relation_ShowRHeader(x); x=0; } print " "; (proutine1).call(obj1); print " >=> ", (the) obj2, "^"; } } return; } for (obj1=1:obj1<=vtov_structure-->2:obj1++) for (obj2=1:obj2<=vtov_structure-->VTOVS_RIGHT_DOMAIN_SIZE:obj2++) if (Relation_TestVtoV(obj1, vtov_structure, obj2)) { if (x) { Relation_ShowRHeader(x); x=0; } print " "; (proutine1).call(obj1); print " >=> "; (proutine2).call(obj2); print "^"; } ]; [ Relation_ShowOtoO relation_property sym x obj1 obj2; objectloop (obj1 provides relation_property) { obj2 = obj1.relation_property; if (sym && obj2 < obj1) continue; if (obj2 == 0) continue; if (x) { Relation_ShowRHeader(x); x=0; } print " ", (The) obj1; if (sym) print " == "; else print " >=> "; print (the) obj2, "^"; } ]; [ Relation_RShowOtoO relation_property sym x obj1 obj2; objectloop (obj1) { objectloop (obj2 provides relation_property) { if (obj2.relation_property ~= obj1) continue; if (x) { Relation_ShowRHeader(x); x=0; } print " ", (The) obj1; print " >=> "; print (the) obj2, "^"; } } ]; [ Relation_ShowEquiv relation_property obj1 obj2 v c somegroups; objectloop (obj1 provides relation_property) obj1.relation_property = -(obj1.relation_property); objectloop (obj1 provides relation_property) { if (obj1.relation_property < 0) { v = obj1.relation_property; c = 0; objectloop (obj2 has workflag2) give obj2 ~workflag2; objectloop (obj2 provides relation_property) { if (obj2.relation_property == v) { give obj2 workflag2; obj2.relation_property = -v; c++; } } if (c>1) { somegroups = true; print " { "; WriteListOfMarkedObjects(ENGLISH_BIT); print " }^"; } else obj1.relation_property = v; } } objectloop (obj2 has workflag2) give obj2 ~workflag2; c = 0; objectloop (obj1 provides relation_property) if (obj1.relation_property < 0) { c++; give obj1 workflag2; } if (c == 0) return; if (somegroups) print " and "; else print " "; if (c < 4) { WriteListOfMarkedObjects(ENGLISH_BIT); print " in"; } else print c; if (c == 1) print " a"; print " single-member group"; if (c > 1) print "s"; print "^"; objectloop (obj1 provides relation_property) if (obj1.relation_property < 0) obj1.relation_property = -(obj1.relation_property); ]; #ifndef FAST_ROUTE_FINDING; #ifndef SLOW_ROUTE_FINDING; #ifdef TARGET_GLULX; Constant FAST_ROUTE_FINDING; #ifnot; Constant SLOW_ROUTE_FINDING; #endif; #endif; #endif; Constant NUM_DOORS = 0; Constant NUM_ROOMS = 4; Array DoorRoutingViable -> NUM_DOORS+1; Global map_has_changed = true; Global last_filter; Global last_use_doors; [ SignalMapChange; map_has_changed = true; ]; [ MapRouteTo from to filter use_doors count oy oyi ds; if (from == nothing) return nothing; if (to == nothing) return nothing; if (from == to) return nothing; if ((filter) && (filter(from) == 0)) return nothing; if ((filter) && (filter(to) == 0)) return nothing; if ((last_filter ~= filter) || (last_use_doors ~= use_doors)) map_has_changed = true; oyi = 0; objectloop (oy has mark_as_room) { if ((filter == 0) || (filter(oy))) { if (oy.room_index == -1) map_has_changed = true; oy.room_index = oyi++; } else { if (oy.room_index >= 0) map_has_changed = true; oy.room_index = -1; } } oyi = 0; objectloop (oy ofclass K4_door) { ds = false; if ((use_doors & 2) || (oy has open) || ((oy has openable) && (oy hasnt locked))) ds = true; if (DoorRoutingViable->oyi ~= ds) map_has_changed = true; DoorRoutingViable->oyi = ds; oyi++; } if (map_has_changed) { #ifdef FAST_ROUTE_FINDING; ComputeFWMatrix(filter, use_doors); #endif; map_has_changed = false; last_filter = filter; last_use_doors = use_doors; } #ifdef FAST_ROUTE_FINDING; if (count) return FastCountRouteTo(from, to, filter, use_doors); return FastRouteTo(from, to, filter, use_doors); #ifnot; if (count) return SlowCountRouteTo(from, to, filter, use_doors); return SlowRouteTo(from, to, filter, use_doors); #endif; ]; #ifdef FAST_ROUTE_FINDING; Array FWMatrix --> NUM_ROOMS*NUM_ROOMS; [ FastRouteTo from to filter use_doors diri i dir oy; diri = (FWMatrix-->(from.room_index*NUM_ROOMS + to.room_index))%No_Directions; objectloop (dir ofclass K3_direction) { if (i == diri) return dir; i++; } return nothing; ]; [ FastCountRouteTo from to filter use_doors oy; return (FWMatrix-->(from.room_index*NUM_ROOMS + to.room_index))/No_Directions; ]; [ ComputeFWMatrix filter use_doors oy ox oj axy ayj axj dir diri nd row; objectloop (oy has mark_as_room) if (oy.room_index >= 0) objectloop (ox has mark_as_room) if (ox.room_index >= 0) FWMatrix-->(oy.room_index*NUM_ROOMS + ox.room_index) = 0; objectloop (oy has mark_as_room) if (oy.room_index >= 0) { row = (oy.IK_1)*No_Directions; for (diri=0: diri(row+diri); if ((ox) && (ox has mark_as_room) && (ox.room_index >= 0)) { FWMatrix-->(oy.room_index*NUM_ROOMS + ox.room_index) = No_Directions + diri; continue; } if ((ox ofclass K4_door) && (DoorRoutingViable->(ox.IK_4))) { @push location; location = oy; ox = ox.door_to(); @pull location; if ((ox) && (ox has mark_as_room) && (ox.room_index >= 0)) { FWMatrix-->(oy.room_index*NUM_ROOMS + ox.room_index) = No_Directions + diri; continue; } } } } objectloop (oy has mark_as_room) if (oy.room_index >= 0) objectloop (ox has mark_as_room) if (ox.room_index >= 0) { axy = (FWMatrix-->(ox.room_index*NUM_ROOMS + oy.room_index))/No_Directions; if (axy > 0) objectloop (oj has mark_as_room) if (oj.room_index >= 0) { ayj = (FWMatrix-->(oy.room_index*NUM_ROOMS + oj.room_index))/No_Directions; if (ayj > 0) { !print "Is it faster to go from ", (name) ox, " to ", ! (name) oj, " via ", (name) oy, "?^"; axj = (FWMatrix-->(ox.room_index*NUM_ROOMS + oj.room_index))/ No_Directions; if ((axj == 0) || (axy + ayj < axj)) { !print "Yes^"; FWMatrix-->(ox.room_index*NUM_ROOMS + oj.room_index) = (axy + ayj)*No_Directions + (FWMatrix-->(ox.room_index*NUM_ROOMS + oy.room_index))% No_Directions; } } } } ]; #ENDIF; #ifndef FAST_ROUTE_FINDING; [ SlowRouteTo from to filter use_doors obj dir in_direction progressed sl through_door; if (from == nothing) return nothing; if (to == nothing) return nothing; if (from == to) return nothing; objectloop (obj has mark_as_room) obj.vector = 0; to.vector = 1; !print "Routing from ", (the) from, " to ", (the) to, "^"; while (true) { progressed = false; !print "Pass begins^"; objectloop (obj has mark_as_room) if ((filter == 0) || (filter(obj))) if (obj.vector == 0) objectloop (dir ofclass K3_direction) { in_direction = Map_Storage-->((obj.IK_1)*No_Directions + dir.IK_3); if (in_direction == nothing) continue; !print (the) obj, " > ", (the) dir, " > ", (the) in_direction, "^"; if ((in_direction) && (in_direction has mark_as_room) && (in_direction.vector > 0) && ((filter == 0) || (filter(in_direction)))) { obj.vector = dir | WORD_HIGHBIT; !print "* ", (the) obj, " vector is ", (the) dir, "^"; progressed = true; continue; } if (use_doors && (in_direction ofclass K4_door) && ((use_doors & 2) || (in_direction has open) || ((in_direction has openable) && (in_direction hasnt locked)))) { sl = location; location = obj; through_door = in_direction.door_to(); location = sl; !print "Through door is ", (the) through_door, "^"; if ((through_door) && (through_door has mark_as_room) && (through_door.vector > 0) && ((filter == 0) || (filter(through_door)))) { obj.vector = dir | WORD_HIGHBIT; !print "* ", (the) obj, " vector is ", (the) dir, "^"; progressed = true; continue; } } } objectloop (obj has mark_as_room) obj.vector = obj.vector &~ WORD_HIGHBIT; if (from.vector) return from.vector; if (progressed == false) return from.vector; } ]; [ SlowCountRouteTo from to filter use_doors obj i; if (from == nothing) return -1; if (to == nothing) return -1; if (from == to) return 0; if (from has mark_as_room && to has mark_as_room) { obj = MapRouteTo(from,to,filter,use_doors); if (obj == nothing) return -1; i = 0; obj = from; while ((obj ~= to) && (i(3*relation); relation_kind = relation_metadata-->(3*relation+1); if (relation_kind == Relation_ByRoutine or Relation_Implicit) { RunTimeProblem(RTP_ROUTELESS); return nothing; } if (relation_data == 0) return nothing; switch(relation_kind) { Relation_OtoO: rv = OtoVRelRouteTo(relation_data, from, to); Relation_VtoO: rv = VtoORelRouteTo(relation_data, from, to); Relation_OtoV: rv = OtoVRelRouteTo(relation_data, from, to); default: return VtoVRelRouteTo(relation_data, from, to, count); } if (count) { if (rv == nothing) return -1; i = 0; obj = from; while ((obj ~= to) && (i<=MAX_ROUTE_LENGTH)) { i++; obj = obj.vector; } return i; } return rv; ]; [ OtoVRelRouteTo relation_property from to previous; while ((to) && (to provides relation_property) && (to.relation_property)) { previous = to.relation_property; previous.vector = to; if (previous == from) return to; to = previous; } return nothing; ]; [ VtoORelRouteTo relation_property from to next start; start = from; while ((from) && (from provides relation_property) && (from.relation_property)) { next = from.relation_property; from.vector = next; if (from == to) return start.vector; from = next; } return nothing; ]; [ VtoVRelRouteTo vtov_structure from to count obj obj2 related progressed left_ix pr2 i; if (vtov_structure-->VTOVS_CACHE) return FastVtoVRelRouteTo(vtov_structure, from, to, count); left_ix = vtov_structure-->VTOVS_LEFT_INDEX_PROP; pr2 = vtov_structure-->VTOVS_RIGHT_INDEX_PROP; objectloop (obj ofclass Object && obj provides vector) obj.vector = 0; to.vector = 1; while (true) { progressed = false; objectloop (obj ofclass Object && obj provides left_ix) if (obj.vector == 0) { objectloop (obj2 ofclass Object && obj2 provides pr2 && obj2.vector > 0) { if (Relation_TestVtoV(obj, vtov_structure, obj2)) { obj.vector = obj2 | WORD_HIGHBIT; progressed = true; continue; } } } objectloop (obj ofclass Object && obj provides left_ix) obj.vector = obj.vector &~ WORD_HIGHBIT; if (from.vector) break; if (progressed == false) break; } if (count) { if (from.vector == nothing) return -1; i = 0; obj = from; while ((obj ~= to) && (i<=MAX_ROUTE_LENGTH)) { i++; obj = obj.vector; } return i; } return from.vector; ]; [ FastVtoVRelRouteTo vtov_structure from to count domainsize cache cache2 left_ix ox oy oj offset axy axj ayj; domainsize = vtov_structure-->2; ! Number of left instances left_ix = vtov_structure-->VTOVS_LEFT_INDEX_PROP; if ((from provides left_ix) && (to provides left_ix)) { if (domainsize < 256) { cache = vtov_structure-->VTOVS_CACHE; cache2 = cache + domainsize*domainsize; if (vtov_structure-->VTOVS_CACHE_BROKEN == true) { vtov_structure-->VTOVS_CACHE_BROKEN = false; objectloop (oy provides left_ix) objectloop (ox provides left_ix) if (Relation_TestVtoV(oy, vtov_structure, ox)) { offset = ((oy.left_ix)*domainsize + (ox.left_ix)); cache->offset = 1; cache2->offset = ox.left_ix; } else { offset = ((oy.left_ix)*domainsize + (ox.left_ix)); cache->offset = 0; cache2->offset = 255; } for (oy=0: oy(ox*domainsize + oy); if (axy > 0) for (oj=0: oj(oy*domainsize + oj); if (ayj > 0) { offset = ox*domainsize + oj; axj = cache->offset; if ((axj == 0) || (axy + ayj < axj)) { cache->offset = (axy + ayj); cache2->offset = cache2->(ox*domainsize + oy); } } } } } if (count) { count = cache->((from.left_ix)*domainsize + (to.left_ix)); if (count == 0) return -1; return count; } oy = cache2->((from.left_ix)*domainsize + (to.left_ix)); if (oy < 255) objectloop (ox provides left_ix) if (ox.left_ix == oy) return oy; return nothing; } else { cache = vtov_structure-->VTOVS_CACHE; cache2 = cache + WORDSIZE*domainsize*domainsize; if (vtov_structure-->VTOVS_CACHE_BROKEN == true) { vtov_structure-->VTOVS_CACHE_BROKEN = false; objectloop (oy provides left_ix) objectloop (ox provides left_ix) if (Relation_TestVtoV(oy, vtov_structure, ox)) { offset = ((oy.left_ix)*domainsize + (ox.left_ix)); cache-->offset = 1; cache2-->offset = ox; } else { offset = ((oy.left_ix)*domainsize + (ox.left_ix)); cache-->offset = 0; cache2-->offset = nothing; } for (oy=0: oy(ox*domainsize + oy); if (axy > 0) for (oj=0: oj(oy*domainsize + oj); if (ayj > 0) { offset = ox*domainsize + oj; axj = cache-->offset; if ((axj == 0) || (axy + ayj < axj)) { cache-->offset = (axy + ayj); cache2-->offset = cache2-->(ox*domainsize + oy); } } } } } if (count) { count = cache-->((from.left_ix)*domainsize + (to.left_ix)); if (count == 0) return -1; return count; } return cache2-->((from.left_ix)*domainsize + (to.left_ix)); } } if (count) return -1; return nothing; ]; [ RunTimeProblem n par1 par2 par3 ln i c; if (enable_rte == false) return; enable_rte = false; print "^*** Run-time problem P", n; if (ln) print " (at paragraph ", ln, " in the source text)"; print ": "; switch(n) { RTP_BACKDROP: print "Tried to move ", (the) par1, " (a backdrop) to ", (the) par2, ", which is not a region.^"; RTP_CANTCHANGE: print "Tried to change player to ", (the) par1, ", which is not a player-character.^"; RTP_NOEXIT: print "Tried to change ", (the) par2, " exit of ", (the) par1, ", but it didn't seem to have such an exit to change.^"; RTP_EXITDOOR: print "Tried to change ", (the) par2, " exit of ", (the) par1, ", but it led to a door, not a room.^"; RTP_IMPREL: print "Tried to access an inappropriate relation for ", (the) par1, ", violating '"; for (i=0: relation_metadata-->i ~= NULL: i=i+3) { c = relation_metadata-->(i+1); if (((c == Relation_VtoV) || (c == Relation_Sym_VtoV)) && (par2 == relation_metadata-->i)) print (string) relation_metadata-->(i+2), "'.^"; } RTP_RULESTACK: print "Too many procedural rules acting all at once.^"; RTP_TOOMANYRULEBOOKS: print "Too many rulebooks in simultaneous use.^"; RTP_TOOMANYEVENTS: print "Too many timed events are going on at once.^"; RTP_BADPROPERTY: print "Tried to access non-existent property for ", (the) par1, ".^"; RTP_UNPROVIDED: print "Since ", (the) par1, " is not allowed the property ~", (string) par2, "~, it is against the rules to try to use it.^"; RTP_UNSET: print "Although ", (the) par1, " is allowed to have the property ~", (string) par2, "~, no value was ever given, so it can't now be used.^"; RTP_TOOMANYACTS: print "Too many activities are going on at once.^"; RTP_CANTABANDON: print "Tried to abandon an activity which wasn't going on.^"; RTP_CANTEND: print "Tried to end an activity which wasn't going on.^"; RTP_CANTMOVENOTHING: print "You can't move nothing.^"; RTP_CANTREMOVENOTHING: print "You can't remove nothing from play.^"; RTP_DIVZERO: print "You can't divide by zero.^"; RTP_BADVALUEPROPERTY: print "Tried to access property for a value which didn't fit: ", "if this were a number it would be ", par1, ".^"; RTP_NOTBACKDROP: print "Tried to move ", (the) par1, " (not a backdrop) to ", (the) par2, ", which is a region.^"; RTP_TABLE_NOCOL: print "Attempt to look up a non-existent column in the table '", (PrintTableName) par1, "'.^"; RTP_TABLE_NOCORR: print "Attempt to look up a non-existent correspondence in the table '", (PrintTableName) par1, "'.^"; RTP_TABLE_NOROW: print "Attempt to look up a non-existent row in the table '", (PrintTableName) par1, "'.^"; RTP_TABLE_NOENTRY: print "Attempt to look up a non-existent entry at column ", par2, ", row ", par3, " of the table '", (PrintTableName) par1, "'.^"; RTP_TABLE_NOTABLE: print "Attempt to blank out a row from a non-existent table (value ", par1, ").^"; RTP_TABLE_NOMOREBLANKS: print "Attempt to choose a blank row in a table with none left: table '", (PrintTableName) par1, "'.^"; RTP_TABLE_NOROWS: print "Attempt to choose a random row in an entirely blank table: table '", (PrintTableName) par1, "'.^"; RTP_TABLE_CANTSORT: print "Attempt to sort a table whose ordering must remain fixed: table '", (PrintTableName) par1, "'.^"; RTP_TABLE_CANTSAVE: print "Attempt to save a table to a file whose data is unstable: table '", (PrintTableName) par1, "'.^"; RTP_TABLE_WONTFIT: print "File being read has too many rows or columns to fit into table: table '", (PrintTableName) par1, "'.^"; RTP_TABLE_BADFILE: print "File being read is not a previously saved table: table '", (PrintTableName) par1, "'.^"; RTP_NOTINAROOM: print "Attempt to test if the current location is '", (the) par1, "', which is not a room or region.^"; RTP_BADTOPIC: print "Attempt to see if a snippet of text matches something which is not a topic.^"; RTP_ROUTELESS: print "Attempt to find route or count steps through an implicit relation.^"; RTP_PROPOFNOTHING: print "Attempt to use a property of the 'nothing' non-object.^"; RTP_DECIDEONWRONGKIND: print "Attempt to 'decide on V' where V is the wrong kind of object.^"; RTP_DECIDEONNOTHING: print "Attempt to 'decide on nothing'.^"; RTP_LOWLEVELERROR: print "Low level error.^"; RTP_DONTIGNORETURNSEQUENCE: print "Attempt to ignore the turn sequence rules.^"; RTP_SAYINVALIDSNIPPET: print "Attempt to say a snippet value which is currently invalid: words ", par1, " to ", par2, ".^"; RTP_SPLICEINVALIDSNIPPET: print "Attempt to splice a snippet value which is currently invalid: words ", par1, " to ", par2, ".^"; RTP_INCLUDEINVALIDSNIPPET: print "Attempt to match a snippet value which is currently invalid: words ", par1, " to ", par2, ".^"; RTP_LISTWRITERMEMORY: print "The list-writer has run out of memory.^"; RTP_CANTREMOVEPLAYER: print "Attempt to remove the player from play.^"; RTP_CANTREMOVEDOORS: print "Attempt to remove a door from play.^"; RTP_CANTCHANGEOFFSTAGE: print "Attempt to change the player to a person off-stage.^"; RTP_MSTACKMEMORY: print "The memory stack is exhausted.^"; RTP_TYPECHECK: print "Phrase applied to an incompatible kind of value.^"; RTP_FILEIOERROR: print "Error handling external file.^"; RTP_HEAPERROR: print "Memory allocation proved impossible.^"; RTP_LISTRANGEERROR: print "Attempt to use list item which does not exist.^"; RTP_REGEXPSYNTAXERROR: print "Syntax error in regular expression.^"; RTP_NOGLULXUNICODE: print "This interpreter does not support Unicode.^"; RTP_BACKDROPONLY: print "Only backdrops can be moved to multiple places.^"; RTP_NOTBACKDROP: print "Tried to move ", (the) par1, " (not a thing) to ", (the) par2, ", but only things can move around.^"; RTP_SCENEHASNTSTARTED: print "The scene ", (PrintSceneName) par1, " hasn't started, so you can't ask when it did.^"; RTP_SCENEHASNTENDED: print "The scene ", (PrintSceneName) par1, " hasn't ended, so you can't ask when it did.^"; RTP_NEGATIVEROOT: print "You can't take the square root of a negative number.^"; } print "^"; ]; Constant MAX_TIMERS = 0; [ RunTimeError n p1 p2; #Ifdef DEBUG; print "** Library error ", n, " (", p1, ",", p2, ") **^** "; switch (n) { 1: print "preposition not found (this should not occur)"; 2: print "Property value not routine or string: ~", (property) p2, "~ of ~", (name) p1, "~ (", p1, ")"; 3: print "Entry in property list not routine or string: ~", (property) p2, "~ list of ~", (name) p1, "~ (", p1, ")"; 4: print "Too many timers/daemons are active simultaneously. The limit is the library constant MAX_TIMERS (currently ", MAX_TIMERS, ") and should be increased"; 5: print "Object ~", (name) p1, "~ has no ~time_left~ property"; 7: print "The object ~", (name) p1, "~ can only be used as a player object if it has the ~number~ property"; 8: print "Attempt to take random entry from an empty table array"; 9: print p1, " is not a valid direction property number"; 10: print "The player-object is outside the object tree"; 11: print "The room ~", (name) p1, "~ has no ~description~ property"; 12: print "Tried to set a non-existent pronoun using SetPronoun"; 13: print "A 'topic' token can only be followed by a preposition"; default: print "(unexplained)"; } print " **^"; #Ifnot; print "** Library error ", n, " (", p1, ",", p2, ") **^"; #Endif; ! DEBUG RunTimeProblem(RTP_LOWLEVELERROR); ]; [ ArgumentTypeFailed file line arg; RunTimeProblem(RTP_TYPECHECK, 0, 0, 0, line); ]; [ CheckKindReturned V K; if (V ofclass K) return V; if (v == nothing) RunTimeProblem(RTP_DECIDEONNOTHING); else RunTimeProblem(RTP_DECIDEONWRONGKIND); return V; ]; [ WhetherProvides obj either_or p issue_rtp off i textual a l; if (metaclass(obj) ~= Object) rfalse; if (p<0) p = ~p; if (either_or) { if (p < FBNA_PROP_NUMBER) off = attribute_offsets-->p; else off = attribute_offsets-->(50+p-FBNA_PROP_NUMBER); } else off = property_offsets-->p; if (off<0) { if (issue_rtp) RunTimeProblem(RTP_BADPROPERTY, obj); rfalse; } textual = property_metadata-->off; off++; if (ScanPropertyMetadata(obj, off)) jump PermissionFound; if (obj provides IK_0) { l = obj.IK_0; while (l > 0) { a = l*2; if (ScanPropertyMetadata(KindHierarchy-->a, off)) jump PermissionFound; l = KindHierarchy-->(a+1); } } if (issue_rtp) RunTimeProblem(RTP_UNPROVIDED, obj, textual); rfalse; .PermissionFound; if (either_or) rtrue; if (obj provides p) rtrue; if (issue_rtp) RunTimeProblem(RTP_UNSET, obj, textual); rfalse; ]; [ ScanPropertyMetadata obj off i; for (i=off: property_metadata-->i >= 0: i++) if (obj == property_metadata-->i) rtrue; rfalse; ]; [ GetEitherOrProperty o p; if (o == nothing) rfalse; if (p<0) p = ~p; if (WhetherProvides(o, true, p, false)) { if (p0; return kovp_array-->(1+(inst-1)*per+off); ]; [ WritePropertyKOV kovp_array off inst state per; per = kovp_array-->0; kovp_array-->(1+(inst-1)*per+off) = state; ]; [ ValueProperty obj pr; if (ValuePropertyHolder provides pr) { if ((obj<=0) || (obj > (ValuePropertyHolder.pr)-->0)) { RunTimeProblem(RTP_BADVALUEPROPERTY); rfalse; } return (ValuePropertyHolder.pr)-->(obj+COL_HSIZE); } if (obj == 0) { RunTimeProblem(RTP_PROPOFNOTHING, obj, pr); rfalse; } if ((pr == door_to) && (obj provides pr)) return obj.pr(); if (WhetherProvides(obj, false, pr, true)) return obj.pr; rfalse; ]; [ WriteValueProperty obj pr val; if (ValuePropertyHolder provides pr) { if ((obj<=0) || (obj > (ValuePropertyHolder.pr)-->0)) return RunTimeProblem(RTP_BADVALUEPROPERTY); (ValuePropertyHolder.pr)-->(obj+COL_HSIZE) = val; return; } if (obj == 0) { RunTimeProblem(RTP_PROPOFNOTHING, obj, pr); rfalse; } if (WhetherProvides(obj, false, pr, true)) obj.pr = val; ]; Constant RULECHANGE_STACK_SIZE = 501; Global rulechange_sp = 0; Array rulechange_stack --> RULECHANGE_STACK_SIZE; [ PushRuleChange usage rule1 rule2; if (rulechange_sp >= RULECHANGE_STACK_SIZE) return RunTimeProblem(RTP_RULESTACK); rulechange_stack-->rulechange_sp++ = usage; rulechange_stack-->rulechange_sp++ = rule1; rulechange_stack-->rulechange_sp++ = rule2; ]; Constant RS_FRAME = -1; Constant RS_DONOTRUN = 1; Constant RS_RUN = 2; Constant RS_MOVEBEFORE = 3; Constant RS_MOVEAFTER = 4; Constant RS_DONOTUSE = 5; Constant RS_USE = 6; Constant RS_SUBSTITUTE = 7; Constant RS_SUCCEEDS = 8; Constant RS_FAILS = 9; Constant RS_NEITHER = 10; Global rule_frames = 0; ! Number of frames currently in force Constant MAX_SIMULTANEOUS_FRAMES = 20; [ FollowRulebook rulebook parameter no_paragraph_skips rv; @push self; if ((Protect_I7_Arrays-->0 ~= 16339) || (Protect_I7_Arrays-->1 ~= 12345)) { print "^^*** Fatal programming error: I7 arrays corrupted ***^^"; @quit; } if (parameter) self = parameter; if (rulebook ~= PROCEDURAL_RB) BeginFollowRulebook(); rv = ProcessRulebook(rulebook, parameter, no_paragraph_skips); if (rulebook ~= PROCEDURAL_RB) EndFollowRulebook(); @pull self; if (rv) rtrue; rfalse; ]; [ BeginFollowRulebook; PushRuleChange(RS_FRAME, RS_FRAME, RS_FRAME); rule_frames++; if (rule_frames == MAX_SIMULTANEOUS_FRAMES) { RunTimeProblem(RTP_TOOMANYRULEBOOKS); rule_frames = -1; ! For recovery: this terminates rulebook processing return; } ProcessRulebook(PROCEDURAL_RB, 0, true); ]; [ EndFollowRulebook r x y; if (rulechange_stack-->rulechange_sp == RS_SUCCEEDS) r = 1; else if (rulechange_stack-->rulechange_sp == RS_FAILS) r = 0; else r = -1; if (r ~= -1) { x = rulechange_stack-->(rulechange_sp+1); y = rulechange_stack-->(rulechange_sp+2); } rule_frames--; while (rulechange_sp > 0) { rulechange_sp = rulechange_sp - 3; if (rulechange_stack-->rulechange_sp == RS_FRAME) break; } if (rulechange_sp == 0) rule_frames = 0; if (r == 1) rulechange_stack-->rulechange_sp = RS_SUCCEEDS; else if (r == 0) rulechange_stack-->rulechange_sp = RS_FAILS; if (r ~= -1) { rulechange_stack-->(rulechange_sp+1) = x; rulechange_stack-->(rulechange_sp+2) = y; } ]; Constant RS_ACTIVE_BIT = 1; Constant RS_MOVED_BIT = 2; Constant RS_USERESULT_BIT = 4; Constant RS_ACTIVITY = 8; Constant RS_NOSKIPS = 16; Constant RS_AFFECTED_BIT = 32; Global process_rulebook_count; ! Depth of processing recursion Global debugging_rules = false; ! Are we tracing rule invocations? [ ProcessRulebook rulebook parameter bits rv x frame_base substituted_rule usage original_deadflag rbaddress ra acf gc ga; if (bits) bits = RS_ACTIVITY + RS_NOSKIPS; if (say__pc & PARA_NORULEBOOKBREAKS) bits = bits | RS_NOSKIPS; if (rule_frames<0) rfalse; if (parameter) parameter_object = parameter; for (x = rulechange_sp-3: x>=0: x = x - 3) { usage = rulechange_stack-->x; if (usage == RS_FRAME) { x=x+3; break; } if (rulechange_stack-->(x+1) == rulebook) { bits = bits | (RS_AFFECTED_BIT); if (usage == RS_MOVEBEFORE or RS_MOVEAFTER) bits = bits | (RS_MOVED_BIT); } if (rulechange_stack-->(x+2) == rulebook) { bits = bits | (RS_AFFECTED_BIT); } } if (x<0) x=0; frame_base = x; if ((bits & RS_MOVED_BIT) && (rv == false)) { rfalse; } ! rv was a call parameter: it's no longer needed and is now reused bits = bits | (RS_ACTIVE_BIT + RS_USERESULT_BIT); substituted_rule = rulebook; rv = 0; if (bits & RS_AFFECTED_BIT) for (: xx; if (rulechange_stack-->(x+1) == rulebook) { if (usage == RS_DONOTRUN) bits = bits & (~RS_ACTIVE_BIT); if (usage == RS_RUN) bits = bits | (RS_ACTIVE_BIT); if (usage == RS_DONOTUSE) bits = bits & (~RS_USERESULT_BIT); if (usage == RS_USE) bits = bits | (RS_USERESULT_BIT); if (usage == RS_SUBSTITUTE) substituted_rule = rulechange_stack-->(x+2); } if ((usage == RS_MOVEBEFORE) && (rulechange_stack-->(x+2) == rulebook)) { rv = ProcessRulebook(rulechange_stack-->(x+1), parameter, (bits & RS_ACTIVITY ~= 0), true); if (rv) return rv; } } if ((bits & RS_ACTIVE_BIT) == 0) rfalse; ! We now reuse usage to keep the stack frame slimmer usage = debugging_rules; #ifndef MEMORY_ECONOMY; if (debugging_rules) DebugRulebooks(substituted_rule, parameter); #endif; ! (A routine defined in the I7 code generator) process_rulebook_count = process_rulebook_count + debugging_rules; if ((substituted_rule >= 0) && (substituted_rule < NUMBER_RULEBOOKS_CREATED)) { rbaddress = rulebooks_array-->substituted_rule; ra = rbaddress-->0; x = 0; original_deadflag = deadflag; if (ra ~= NULL) { acf = (bits & RS_ACTIVITY ~= 0); if (substituted_rule ~= ACTION_PROCESSING_RB) MStack_CreateRBVars(substituted_rule); if (ra == (-2)) { for (x=1: original_deadflag == deadflag: x++) { ra = rbaddress-->x; if (ra == NULL) break; if (gc == 0) { ga = ra; x++; gc = rbaddress-->x; if ((gc<1) || (gc>31)) { gc = 1; x--; } x++; ra = rbaddress-->x; } gc--; if (ga ~= (-2) or action) continue; if ((rv = (ProcessRulebook(ra, parameter, acf))) && (bits & RS_USERESULT_BIT)) jump NonNullResult; } } else { for (: original_deadflag == deadflag: x++) { ra = rbaddress-->x; if (ra == NULL) break; if ((rv = (ProcessRulebook(ra, parameter, acf))) && (bits & RS_USERESULT_BIT)) jump NonNullResult; } } rv = 0; .NonNullResult; if (substituted_rule ~= ACTION_PROCESSING_RB) MStack_DestroyRBVars(substituted_rule); } } else { if ((say__p) && (bits & RS_NOSKIPS == 0)) DivideParagraphPoint(); rv = indirect(substituted_rule); if (rv) rv = substituted_rule; } if (rv && (bits & RS_USERESULT_BIT)) { process_rulebook_count = process_rulebook_count - debugging_rules; if (process_rulebook_count < 0) process_rulebook_count = 0; #ifndef MEMORY_ECONOMY; if (debugging_rules) { spaces(2*process_rulebook_count); if (rulechange_stack-->rulechange_sp == RS_SUCCEEDS) print "[stopped: success]^"; if (rulechange_stack-->rulechange_sp == RS_FAILS) print "[stopped: fail]^"; } #endif; debugging_rules = usage; return rv; } if (bits & RS_AFFECTED_BIT) for (x=rulechange_sp-3: x>=frame_base: x = x-3) { if ((rulechange_stack-->x == RS_MOVEAFTER) && (rulechange_stack-->(x+2) == rulebook)) { rv = ProcessRulebook(rulechange_stack-->(x+1), parameter, (bits & RS_ACTIVITY ~= 0), true); if (rv) { process_rulebook_count--; debugging_rules = usage; return rv; } } } process_rulebook_count = process_rulebook_count - debugging_rules; rulechange_stack-->rulechange_sp = 0; debugging_rules = usage; rfalse; ]; [ ActRulebookSucceeds rule_id; if (rule_id) reason_the_action_failed = rule_id; RulebookSucceeds(); ]; [ ActRulebookFails rule_id; if (rule_id) reason_the_action_failed = rule_id; RulebookFails(); ]; [ RulebookSucceeds valueflag value; PushRuleChange(RS_SUCCEEDS, valueflag, value); rulechange_sp = rulechange_sp - 3; ]; [ RulebookFails valueflag value; PushRuleChange(RS_FAILS, valueflag, value); rulechange_sp = rulechange_sp - 3; ]; [ RuleHasNoOutcome; PushRuleChange(RS_NEITHER, 0, 0); rulechange_sp = rulechange_sp - 3; ]; [ SetRulebookOutcome a; rulechange_stack-->rulechange_sp = a; ]; [ RulebookOutcome a; a = rulechange_stack-->rulechange_sp; if ((a == RS_FAILS) || (a == RS_SUCCEEDS)) return a; return RS_NEITHER; ]; [ RulebookFailed; if (rulechange_stack-->rulechange_sp == RS_FAILS) rtrue; rfalse; ]; [ RulebookSucceeded; if (rulechange_stack-->rulechange_sp == RS_SUCCEEDS) rtrue; rfalse; ]; [ ResultOfRule a; a = rulechange_stack-->rulechange_sp; if ((a == RS_FAILS) || (a == RS_SUCCEEDS)) { a = rulechange_stack-->(rulechange_sp + 1); if (a) return rulechange_stack-->(rulechange_sp + 2); } return 0; ]; Global DITS_said = false; [ SuppressRule rule; if (rule == TURN_SEQUENCE_RB) { if (DITS_said == false) RunTimeProblem(RTP_DONTIGNORETURNSEQUENCE); DITS_said = true; } else PushRuleChange(RS_DONOTRUN, rule, 0); ]; [ ReinstateRule rule; PushRuleChange(RS_RUN, rule, 0); ]; [ DonotuseRule rule; PushRuleChange(RS_DONOTUSE, rule, 0); ]; [ UseRule rule; PushRuleChange(RS_USE, rule, 0); ]; [ SubstituteRule rule1 rule2; PushRuleChange(RS_SUBSTITUTE, rule2, rule1); ]; [ MoveRuleBefore rule1 rule2; PushRuleChange(RS_MOVEBEFORE, rule1, rule2); ]; [ MoveRuleAfter rule1 rule2; PushRuleChange(RS_MOVEAFTER, rule1, rule2); ]; #IFNDEF MEMORY_ECONOMY; Array RulebookNames --> "Procedural rulebook" ! 0 "Startup rulebook" ! 1 "Turn sequence rulebook" ! 2 "Shutdown rulebook" ! 3 "Scene changing rulebook" ! 4 "When play begins rulebook" ! 5 "When play ends rulebook" ! 6 "Every turn rulebook" ! 7 "Action-processing rulebook" ! 8 "Setting action variables rulebook" ! 9 "specific action-processing rulebook" ! 10 "player's action awareness rulebook" ! 11 "Accessibility rulebook" ! 12 "Reaching inside rulebook" ! 13 "Reaching outside rulebook" ! 14 "Visibility rulebook" ! 15 "Persuasion rulebook" ! 16 "Unsuccessful attempt by rulebook" ! 17 "Before rulebook" ! 18 "Instead rulebook" ! 19 "Check rulebook" ! 20 "Carry out rulebook" ! 21 "After rulebook" ! 22 "Report rulebook" ! 23 "does the player mean rulebook" ! 24 "when Entire Game begins rulebook" ! 25 "when Entire Game ends rulebook" ! 26 "before Printing the name rulebook" ! 27 "for Printing the name rulebook" ! 28 "after Printing the name rulebook" ! 29 "before Printing the plural name rulebook" ! 30 "for Printing the plural name rulebook" ! 31 "after Printing the plural name rulebook" ! 32 "before Printing a number rulebook" ! 33 "for Printing a number rulebook" ! 34 "after Printing a number rulebook" ! 35 "before Printing room description details rulebook" ! 36 "for Printing room description details rulebook" ! 37 "after Printing room description details rulebook" ! 38 "before Listing contents rulebook" ! 39 "for Listing contents rulebook" ! 40 "after Listing contents rulebook" ! 41 "before Grouping together rulebook" ! 42 "for Grouping together rulebook" ! 43 "after Grouping together rulebook" ! 44 "before Writing a paragraph about rulebook" ! 45 "for Writing a paragraph about rulebook" ! 46 "after Writing a paragraph about rulebook" ! 47 "before Listing nondescript items rulebook" ! 48 "for Listing nondescript items rulebook" ! 49 "after Listing nondescript items rulebook" ! 50 "before Printing the name of a dark room rulebook" ! 51 "for Printing the name of a dark room rulebook" ! 52 "after Printing the name of a dark room rulebook" ! 53 "before Printing the description of a dark room rulebook" ! 54 "for Printing the description of a dark room rulebook" ! 55 "after Printing the description of a dark room rulebook" ! 56 "before Printing the announcement of darkness rulebook" ! 57 "for Printing the announcement of darkness rulebook" ! 58 "after Printing the announcement of darkness rulebook" ! 59 "before Printing the announcement of light rulebook" ! 60 "for Printing the announcement of light rulebook" ! 61 "after Printing the announcement of light rulebook" ! 62 "before Printing a refusal to act in the dark rulebook" ! 63 "for Printing a refusal to act in the dark rulebook" ! 64 "after Printing a refusal to act in the dark rulebook" ! 65 "before Constructing the status line rulebook" ! 66 "for Constructing the status line rulebook" ! 67 "after Constructing the status line rulebook" ! 68 "before Printing the banner text rulebook" ! 69 "for Printing the banner text rulebook" ! 70 "after Printing the banner text rulebook" ! 71 "before Reading a command rulebook" ! 72 "for Reading a command rulebook" ! 73 "after Reading a command rulebook" ! 74 "before Deciding the scope rulebook" ! 75 "for Deciding the scope rulebook" ! 76 "after Deciding the scope rulebook" ! 77 "before Deciding the concealed possessions rulebook" ! 78 "for Deciding the concealed possessions rulebook" ! 79 "after Deciding the concealed possessions rulebook" ! 80 "before Deciding whether all includes rulebook" ! 81 "for Deciding whether all includes rulebook" ! 82 "after Deciding whether all includes rulebook" ! 83 "before Clarifying the parser's choice rulebook" ! 84 "for Clarifying the parser's choice rulebook" ! 85 "after Clarifying the parser's choice rulebook" ! 86 "before Asking which do you mean rulebook" ! 87 "for Asking which do you mean rulebook" ! 88 "after Asking which do you mean rulebook" ! 89 "before Printing a parser error rulebook" ! 90 "for Printing a parser error rulebook" ! 91 "after Printing a parser error rulebook" ! 92 "before Supplying a missing noun rulebook" ! 93 "for Supplying a missing noun rulebook" ! 94 "after Supplying a missing noun rulebook" ! 95 "before Supplying a missing second noun rulebook" ! 96 "for Supplying a missing second noun rulebook" ! 97 "after Supplying a missing second noun rulebook" ! 98 "before Implicitly taking rulebook" ! 99 "for Implicitly taking rulebook" ! 100 "after Implicitly taking rulebook" ! 101 "before Starting the virtual machine rulebook" ! 102 "for Starting the virtual machine rulebook" ! 103 "after Starting the virtual machine rulebook" ! 104 "before Amusing a victorious player rulebook" ! 105 "for Amusing a victorious player rulebook" ! 106 "after Amusing a victorious player rulebook" ! 107 "before Printing the player's obituary rulebook" ! 108 "for Printing the player's obituary rulebook" ! 109 "after Printing the player's obituary rulebook" ! 110 "before Handling the final question rulebook" ! 111 "for Handling the final question rulebook" ! 112 "after Handling the final question rulebook" ! 113 "before Printing the locale description rulebook" ! 114 "for Printing the locale description rulebook" ! 115 "after Printing the locale description rulebook" ! 116 "before Choosing notable locale objects rulebook" ! 117 "for Choosing notable locale objects rulebook" ! 118 "after Choosing notable locale objects rulebook" ! 119 "before Printing a locale paragraph about rulebook" ! 120 "for Printing a locale paragraph about rulebook" ! 121 "after Printing a locale paragraph about rulebook" ! 122 "check Taking inventory rulebook" ! 123 "carry out Taking inventory rulebook" ! 124 "report Taking inventory rulebook" ! 125 "check Taking rulebook" ! 126 "carry out Taking rulebook" ! 127 "report Taking rulebook" ! 128 "check Removing it from rulebook" ! 129 "carry out Removing it from rulebook" ! 130 "report Removing it from rulebook" ! 131 "check Dropping rulebook" ! 132 "carry out Dropping rulebook" ! 133 "report Dropping rulebook" ! 134 "check Putting it on rulebook" ! 135 "carry out Putting it on rulebook" ! 136 "report Putting it on rulebook" ! 137 "check Inserting it into rulebook" ! 138 "carry out Inserting it into rulebook" ! 139 "report Inserting it into rulebook" ! 140 "check Eating rulebook" ! 141 "carry out Eating rulebook" ! 142 "report Eating rulebook" ! 143 "check Going rulebook" ! 144 "carry out Going rulebook" ! 145 "report Going rulebook" ! 146 "check Entering rulebook" ! 147 "carry out Entering rulebook" ! 148 "report Entering rulebook" ! 149 "check Exiting rulebook" ! 150 "carry out Exiting rulebook" ! 151 "report Exiting rulebook" ! 152 "check Getting off rulebook" ! 153 "carry out Getting off rulebook" ! 154 "report Getting off rulebook" ! 155 "check Looking rulebook" ! 156 "carry out Looking rulebook" ! 157 "report Looking rulebook" ! 158 "check Examining rulebook" ! 159 "carry out Examining rulebook" ! 160 "report Examining rulebook" ! 161 "check Looking under rulebook" ! 162 "carry out Looking under rulebook" ! 163 "report Looking under rulebook" ! 164 "check Searching rulebook" ! 165 "carry out Searching rulebook" ! 166 "report Searching rulebook" ! 167 "check Consulting it about rulebook" ! 168 "carry out Consulting it about rulebook" ! 169 "report Consulting it about rulebook" ! 170 "check Locking it with rulebook" ! 171 "carry out Locking it with rulebook" ! 172 "report Locking it with rulebook" ! 173 "check Unlocking it with rulebook" ! 174 "carry out Unlocking it with rulebook" ! 175 "report Unlocking it with rulebook" ! 176 "check Switching on rulebook" ! 177 "carry out Switching on rulebook" ! 178 "report Switching on rulebook" ! 179 "check Switching off rulebook" ! 180 "carry out Switching off rulebook" ! 181 "report Switching off rulebook" ! 182 "check Opening rulebook" ! 183 "carry out Opening rulebook" ! 184 "report Opening rulebook" ! 185 "check Closing rulebook" ! 186 "carry out Closing rulebook" ! 187 "report Closing rulebook" ! 188 "check Wearing rulebook" ! 189 "carry out Wearing rulebook" ! 190 "report Wearing rulebook" ! 191 "check Taking off rulebook" ! 192 "carry out Taking off rulebook" ! 193 "report Taking off rulebook" ! 194 "check Giving it to rulebook" ! 195 "carry out Giving it to rulebook" ! 196 "report Giving it to rulebook" ! 197 "check Showing it to rulebook" ! 198 "carry out Showing it to rulebook" ! 199 "report Showing it to rulebook" ! 200 "check Waking rulebook" ! 201 "carry out Waking rulebook" ! 202 "report Waking rulebook" ! 203 "check Throwing it at rulebook" ! 204 "carry out Throwing it at rulebook" ! 205 "report Throwing it at rulebook" ! 206 "check Attacking rulebook" ! 207 "carry out Attacking rulebook" ! 208 "report Attacking rulebook" ! 209 "check Kissing rulebook" ! 210 "carry out Kissing rulebook" ! 211 "report Kissing rulebook" ! 212 "check Answering it that rulebook" ! 213 "carry out Answering it that rulebook" ! 214 "report Answering it that rulebook" ! 215 "check Telling it about rulebook" ! 216 "carry out Telling it about rulebook" ! 217 "report Telling it about rulebook" ! 218 "check Asking it about rulebook" ! 219 "carry out Asking it about rulebook" ! 220 "report Asking it about rulebook" ! 221 "check Asking it for rulebook" ! 222 "carry out Asking it for rulebook" ! 223 "report Asking it for rulebook" ! 224 "check Waiting rulebook" ! 225 "carry out Waiting rulebook" ! 226 "report Waiting rulebook" ! 227 "check Touching rulebook" ! 228 "carry out Touching rulebook" ! 229 "report Touching rulebook" ! 230 "check Waving rulebook" ! 231 "carry out Waving rulebook" ! 232 "report Waving rulebook" ! 233 "check Pulling rulebook" ! 234 "carry out Pulling rulebook" ! 235 "report Pulling rulebook" ! 236 "check Pushing rulebook" ! 237 "carry out Pushing rulebook" ! 238 "report Pushing rulebook" ! 239 "check Turning rulebook" ! 240 "carry out Turning rulebook" ! 241 "report Turning rulebook" ! 242 "check Pushing it to rulebook" ! 243 "carry out Pushing it to rulebook" ! 244 "report Pushing it to rulebook" ! 245 "check Squeezing rulebook" ! 246 "carry out Squeezing rulebook" ! 247 "report Squeezing rulebook" ! 248 "check Saying yes rulebook" ! 249 "carry out Saying yes rulebook" ! 250 "report Saying yes rulebook" ! 251 "check Saying no rulebook" ! 252 "carry out Saying no rulebook" ! 253 "report Saying no rulebook" ! 254 "check Burning rulebook" ! 255 "carry out Burning rulebook" ! 256 "report Burning rulebook" ! 257 "check Waking up rulebook" ! 258 "carry out Waking up rulebook" ! 259 "report Waking up rulebook" ! 260 "check Thinking rulebook" ! 261 "carry out Thinking rulebook" ! 262 "report Thinking rulebook" ! 263 "check Smelling rulebook" ! 264 "carry out Smelling rulebook" ! 265 "report Smelling rulebook" ! 266 "check Listening to rulebook" ! 267 "carry out Listening to rulebook" ! 268 "report Listening to rulebook" ! 269 "check Tasting rulebook" ! 270 "carry out Tasting rulebook" ! 271 "report Tasting rulebook" ! 272 "check Cutting rulebook" ! 273 "carry out Cutting rulebook" ! 274 "report Cutting rulebook" ! 275 "check Jumping rulebook" ! 276 "carry out Jumping rulebook" ! 277 "report Jumping rulebook" ! 278 "check Tying it to rulebook" ! 279 "carry out Tying it to rulebook" ! 280 "report Tying it to rulebook" ! 281 "check Drinking rulebook" ! 282 "carry out Drinking rulebook" ! 283 "report Drinking rulebook" ! 284 "check Saying sorry rulebook" ! 285 "carry out Saying sorry rulebook" ! 286 "report Saying sorry rulebook" ! 287 "check Swearing obscenely rulebook" ! 288 "carry out Swearing obscenely rulebook" ! 289 "report Swearing obscenely rulebook" ! 290 "check Swearing mildly rulebook" ! 291 "carry out Swearing mildly rulebook" ! 292 "report Swearing mildly rulebook" ! 293 "check Swinging rulebook" ! 294 "carry out Swinging rulebook" ! 295 "report Swinging rulebook" ! 296 "check Rubbing rulebook" ! 297 "carry out Rubbing rulebook" ! 298 "report Rubbing rulebook" ! 299 "check Setting it to rulebook" ! 300 "carry out Setting it to rulebook" ! 301 "report Setting it to rulebook" ! 302 "check Waving hands rulebook" ! 303 "carry out Waving hands rulebook" ! 304 "report Waving hands rulebook" ! 305 "check Buying rulebook" ! 306 "carry out Buying rulebook" ! 307 "report Buying rulebook" ! 308 "check Singing rulebook" ! 309 "carry out Singing rulebook" ! 310 "report Singing rulebook" ! 311 "check Climbing rulebook" ! 312 "carry out Climbing rulebook" ! 313 "report Climbing rulebook" ! 314 "check Sleeping rulebook" ! 315 "carry out Sleeping rulebook" ! 316 "report Sleeping rulebook" ! 317 "check Quitting the game rulebook" ! 318 "carry out Quitting the game rulebook" ! 319 "report Quitting the game rulebook" ! 320 "check Saving the game rulebook" ! 321 "carry out Saving the game rulebook" ! 322 "report Saving the game rulebook" ! 323 "check Restoring the game rulebook" ! 324 "carry out Restoring the game rulebook" ! 325 "report Restoring the game rulebook" ! 326 "check Restarting the game rulebook" ! 327 "carry out Restarting the game rulebook" ! 328 "report Restarting the game rulebook" ! 329 "check Verifying the story file rulebook" ! 330 "carry out Verifying the story file rulebook" ! 331 "report Verifying the story file rulebook" ! 332 "check Switching the story transcript on rulebook" ! 333 "carry out Switching the story transcript on rulebook" ! 334 "report Switching the story transcript on rulebook" ! 335 "check Switching the story transcript off rulebook" ! 336 "carry out Switching the story transcript off rulebook" ! 337 "report Switching the story transcript off rulebook" ! 338 "check Requesting the story file version rulebook" ! 339 "carry out Requesting the story file version rulebook" ! 340 "report Requesting the story file version rulebook" ! 341 "check Requesting the score rulebook" ! 342 "carry out Requesting the score rulebook" ! 343 "report Requesting the score rulebook" ! 344 "check Preferring abbreviated room descriptions rulebook" ! 345 "carry out Preferring abbreviated room descriptions rulebook" ! 346 "report Preferring abbreviated room descriptions rulebook" ! 347 "check Preferring unabbreviated room descriptions rulebook" ! 348 "carry out Preferring unabbreviated room descriptions rulebook" ! 349 "report Preferring unabbreviated room descriptions rulebook" ! 350 "check Preferring sometimes abbreviated room descriptions rulebook" ! 351 "carry out Preferring sometimes abbreviated room descriptions rulebook" ! 352 "report Preferring sometimes abbreviated room descriptions rulebook" ! 353 "check Switching score notification on rulebook" ! 354 "carry out Switching score notification on rulebook" ! 355 "report Switching score notification on rulebook" ! 356 "check Switching score notification off rulebook" ! 357 "carry out Switching score notification off rulebook" ! 358 "report Switching score notification off rulebook" ! 359 "check Requesting the pronoun meanings rulebook" ! 360 "carry out Requesting the pronoun meanings rulebook" ! 361 "report Requesting the pronoun meanings rulebook" ! 362 "check Finding responses to rulebook" ! 363 "carry out Finding responses to rulebook" ! 364 "report Finding responses to rulebook" ! 365 "check Giving text for rulebook" ! 366 "carry out Giving text for rulebook" ! 367 "report Giving text for rulebook" ! 368 "check Giving link to rulebook" ! 369 "carry out Giving link to rulebook" ! 370 "report Giving link to rulebook" ! 371 "check Preparing rulebook" ! 372 "carry out Preparing rulebook" ! 373 "report Preparing rulebook" ! 374 "check Switching the numbers off rulebook" ! 375 "carry out Switching the numbers off rulebook" ! 376 "report Switching the numbers off rulebook" ! 377 "check Switching the numbers on rulebook" ! 378 "carry out Switching the numbers on rulebook" ! 379 "report Switching the numbers on rulebook" ! 380 "reset combat variables rulebook" ! 381 "whether attacking begins rulebook" ! 382 "preliminary results of attacking rulebook" ! 383 "basic attack roll rulebook" ! 384 "whether attack modifiers apply rulebook" ! 385 "attack modifiers rulebook" ! 386 "always-present attack modifiers rulebook" ! 387 "show results of the attack roll rulebook" ! 388 "whether the attack hit rulebook" ! 389 "immediate results of hitting rulebook" ! 390 "basic damage roll rulebook" ! 391 "damage modifiers rulebook" ! 392 "printing-the-damage rulebook" ! 393 "final damage rulebook" ! 394 "report no final damage rulebook" ! 395 "non-fatal damage rulebook" ! 396 "fatal damage rulebook" ! 397 "take away until attack bonuses rulebook" ! 398 "print flavour text rulebook" ! 399 "aftereffects rulebook" ! 400 "final blow report rulebook" ! 401 "check Concentrating rulebook" ! 402 "carry out Concentrating rulebook" ! 403 "report Concentrating rulebook" ! 404 "check Parrying rulebook" ! 405 "carry out Parrying rulebook" ! 406 "report Parrying rulebook" ! 407 "check Dodging rulebook" ! 408 "carry out Dodging rulebook" ! 409 "report Dodging rulebook" ! 410 "standard AI target select rulebook" ! 411 "standard AI weapon select rulebook" ! 412 "standard AI action select rulebook" ! 413 "chance to win rulebook" ! 414 "standard_attacker rulebook" ! 415 "check Readying rulebook" ! 416 "carry out Readying rulebook" ! 417 "report Readying rulebook" ! 418 "intervening flavour text rulebook" ! 419 "flavour rulebook" ! 420 "fatal player flavour rulebook" ! 421 "fatal flavour rulebook" ! 422 "attack move flavour rulebook" ! 423 "check Reloading rulebook" ! 424 "carry out Reloading rulebook" ! 425 "report Reloading rulebook" ! 426 "check Charging rulebook" ! 427 "carry out Charging rulebook" ! 428 "report Charging rulebook" ! 429 ; #ENDIF; ! MEMORY_ECONOMY [ RulePrintingRule R p1; #ifndef MEMORY_ECONOMY; if ((R>=0) && (RR); } else { if (R == R_5) { print "start in the correct scenes rule"; return; } ! 0, case 1 if (R == R_6) { print "when play begins stage rule"; return; } ! 1, case 1 if (R == R_7) { print "fix baseline scoring rule"; return; } ! 2, case 1 if (R == R_8) { print "display banner rule"; return; } ! 3, case 1 if (R == R_9) { print "initial room description rule"; return; } ! 4, case 1 if (R == R_10) { print "every turn stage rule"; return; } ! 5, case 1 if (R == R_13) { print "notify score changes rule"; return; } ! 6, case 1 if (R == R_14) { print "when play ends stage rule"; return; } ! 7, case 1 if (R == R_15) { print "print player's obituary rule"; return; } ! 8, case 1 if (R == R_16) { print "set pronouns from items from multiple object lists rule"; return; } ! 9, case 1 if (R == R_17) { print "announce items from multiple object lists rule"; return; } ! 10, case 1 if (R == R_18) { print "before stage rule"; return; } ! 11, case 1 if (R == R_19) { print "instead stage rule"; return; } ! 12, case 1 if (R == R_20) { print "end action-processing in success rule"; return; } ! 13, case 1 if (R == R_21) { print "investigate player's awareness before action rule"; return; } ! 14, case 1 if (R == R_22) { print "check stage rule"; return; } ! 15, case 1 if (R == R_23) { print "carry out stage rule"; return; } ! 16, case 1 if (R == R_24) { print "after stage rule"; return; } ! 17, case 1 if (R == R_25) { print "investigate player's awareness after action rule"; return; } ! 18, case 1 if (R == R_26) { print "report stage rule"; return; } ! 19, case 1 if (R == R_28) { print "player aware of his own actions rule"; return; } ! 20, case 1 if (R == R_29) { print "player aware of actions by visible actors rule"; return; } ! 21, case 1 if (R == R_30) { print "player aware of actions on visible nouns rule"; return; } ! 22, case 1 if (R == R_31) { print "player aware of actions on visible second nouns rule"; return; } ! 23, case 1 if (R == R_32) { print "can't act in the dark rule"; return; } ! 24, case 1 if (R == R_33) { print "very unlikely to mean taking what's already carried rule"; return; } ! 25, case 1 if (R == R_46) { print "make named things mentioned rule"; return; } ! 26, case 1 if (R == R_47) { print "standard printing the plural name rule"; return; } ! 27, case 1 if (R == R_48) { print "standard printing a number of something rule"; return; } ! 28, case 1 if (R == R_49) { print "look around once light available rule"; return; } ! 29, case 1 if (R == R_50) { print "ambient odour rule"; return; } ! 30, case 1 if (R == R_51) { print "ambient sound rule"; return; } ! 31, case 1 if (R == R_52) { print "block vaguely going rule"; return; } ! 32, case 1 if (R == R_53) { print "print the final prompt rule"; return; } ! 33, case 1 if (R == R_54) { print "print the final question rule"; return; } ! 34, case 1 if (R == R_55) { print "standard respond to final question rule"; return; } ! 35, case 1 if (R == R_58) { print "initialise locale description rule"; return; } ! 36, case 1 if (R == R_59) { print "find notable locale objects rule"; return; } ! 37, case 1 if (R == R_60) { print "interesting locale paragraphs rule"; return; } ! 38, case 1 if (R == R_61) { print "you-can-also-see rule"; return; } ! 39, case 1 if (R == R_62) { print "standard notable locale objects rule"; return; } ! 40, case 1 if (R == R_63) { print "don't mention player's supporter in room descriptions rule"; return; } ! 41, case 1 if (R == R_64) { print "don't mention scenery in room descriptions rule"; return; } ! 42, case 1 if (R == R_65) { print "don't mention undescribed items in room descriptions rule"; return; } ! 43, case 1 if (R == R_66) { print "set pronouns from items in room descriptions rule"; return; } ! 44, case 1 if (R == R_67) { print "offer items to writing a paragraph about rule"; return; } ! 45, case 1 if (R == R_68) { print "use initial appearance in room descriptions rule"; return; } ! 46, case 1 if (R == R_70) { print "describe what's on scenery supporters in room descriptions rule"; return; } ! 47, case 1 if (R == R_71) { print "print empty inventory rule"; return; } ! 48, case 1 if (R == R_72) { print "print standard inventory rule"; return; } ! 49, case 1 if (R == R_73) { print "use inventory to set pronouns rule"; return; } ! 50, case 1 if (R == R_74) { print "report other people taking inventory rule"; return; } ! 51, case 1 if (R == R_75) { print "can't take yourself rule"; return; } ! 52, case 1 if (R == R_76) { print "can't take other people rule"; return; } ! 53, case 1 if (R == R_77) { print "can't take component parts rule"; return; } ! 54, case 1 if (R == R_78) { print "can't take people's possessions rule"; return; } ! 55, case 1 if (R == R_79) { print "can't take items out of play rule"; return; } ! 56, case 1 if (R == R_80) { print "can't take what you're inside rule"; return; } ! 57, case 1 if (R == R_81) { print "can't take what's already taken rule"; return; } ! 58, case 1 if (R == R_82) { print "can't take scenery rule"; return; } ! 59, case 1 if (R == R_83) { print "can only take things rule"; return; } ! 60, case 1 if (R == R_84) { print "can't take what's fixed in place rule"; return; } ! 61, case 1 if (R == R_85) { print "use player's holdall to avoid exceeding carrying capacity rule"; return; } ! 62, case 1 if (R == R_86) { print "can't exceed carrying capacity rule"; return; } ! 63, case 1 if (R == R_87) { print "standard taking rule"; return; } ! 64, case 1 if (R == R_88) { print "standard report taking rule"; return; } ! 65, case 1 if (R == R_89) { print "can't remove what's not inside rule"; return; } ! 66, case 1 if (R == R_90) { print "can't remove from people rule"; return; } ! 67, case 1 if (R == R_91) { print "convert remove to take rule"; return; } ! 68, case 1 if (R == R_92) { print "can't drop yourself rule"; return; } ! 69, case 1 if (R == R_93) { print "can't drop what's already dropped rule"; return; } ! 70, case 1 if (R == R_94) { print "can't drop what's not held rule"; return; } ! 71, case 1 if (R == R_95) { print "can't drop clothes being worn rule"; return; } ! 72, case 1 if (R == R_96) { print "can't drop if this exceeds carrying capacity rule"; return; } ! 73, case 1 if (R == R_97) { print "standard dropping rule"; return; } ! 74, case 1 if (R == R_98) { print "standard report dropping rule"; return; } ! 75, case 1 if (R == R_99) { print "convert put to drop where possible rule"; return; } ! 76, case 1 if (R == R_100) { print "can't put what's not held rule"; return; } ! 77, case 1 if (R == R_101) { print "can't put something on itself rule"; return; } ! 78, case 1 if (R == R_102) { print "can't put onto what's not a supporter rule"; return; } ! 79, case 1 if (R == R_103) { print "can't put onto something being carried rule"; return; } ! 80, case 1 if (R == R_104) { print "can't put clothes being worn rule"; return; } ! 81, case 1 if (R == R_105) { print "can't put if this exceeds carrying capacity rule"; return; } ! 82, case 1 if (R == R_106) { print "standard putting rule"; return; } ! 83, case 1 if (R == R_107) { print "concise report putting rule"; return; } ! 84, case 1 if (R == R_108) { print "standard report putting rule"; return; } ! 85, case 1 if (R == R_109) { print "convert insert to drop where possible rule"; return; } ! 86, case 1 if (R == R_110) { print "can't insert what's not held rule"; return; } ! 87, case 1 if (R == R_111) { print "can't insert something into itself rule"; return; } ! 88, case 1 if (R == R_112) { print "can't insert into closed containers rule"; return; } ! 89, case 1 if (R == R_113) { print "can't insert into what's not a container rule"; return; } ! 90, case 1 if (R == R_114) { print "can't insert clothes being worn rule"; return; } ! 91, case 1 if (R == R_115) { print "can't insert if this exceeds carrying capacity rule"; return; } ! 92, case 1 if (R == R_116) { print "standard inserting rule"; return; } ! 93, case 1 if (R == R_117) { print "concise report inserting rule"; return; } ! 94, case 1 if (R == R_118) { print "standard report inserting rule"; return; } ! 95, case 1 if (R == R_119) { print "can't eat unless edible rule"; return; } ! 96, case 1 if (R == R_120) { print "can't eat clothing without removing it first rule"; return; } ! 97, case 1 if (R == R_121) { print "standard eating rule"; return; } ! 98, case 1 if (R == R_122) { print "standard report eating rule"; return; } ! 99, case 1 if (R == R_123) { print "standard set going variables rule"; return; } ! 100, case 1 if (R == R_124) { print "can't travel in what's not a vehicle rule"; return; } ! 101, case 1 if (R == R_125) { print "can't go through undescribed doors rule"; return; } ! 102, case 1 if (R == R_126) { print "can't go through closed doors rule"; return; } ! 103, case 1 if (R == R_127) { print "determine map connection rule"; return; } ! 104, case 1 if (R == R_128) { print "can't go that way rule"; return; } ! 105, case 1 if (R == R_129) { print "move player and vehicle rule"; return; } ! 106, case 1 if (R == R_130) { print "move floating objects rule"; return; } ! 107, case 1 if (R == R_131) { print "check light in new location rule"; return; } ! 108, case 1 if (R == R_132) { print "describe room gone into rule"; return; } ! 109, case 1 if (R == R_133) { print "convert enter door into go rule"; return; } ! 110, case 1 if (R == R_134) { print "convert enter compass direction into go rule"; return; } ! 111, case 1 if (R == R_135) { print "can't enter what's already entered rule"; return; } ! 112, case 1 if (R == R_136) { print "can't enter what's not enterable rule"; return; } ! 113, case 1 if (R == R_137) { print "can't enter closed containers rule"; return; } ! 114, case 1 if (R == R_138) { print "can't enter something carried rule"; return; } ! 115, case 1 if (R == R_139) { print "implicitly pass through other barriers rule"; return; } ! 116, case 1 if (R == R_140) { print "standard entering rule"; return; } ! 117, case 1 if (R == R_141) { print "standard report entering rule"; return; } ! 118, case 1 if (R == R_142) { print "describe contents entered into rule"; return; } ! 119, case 1 if (R == R_144) { print "convert exit into go out rule"; return; } ! 120, case 1 if (R == R_145) { print "can't exit when not inside anything rule"; return; } ! 121, case 1 if (R == R_146) { print "can't exit closed containers rule"; return; } ! 122, case 1 if (R == R_147) { print "convert exit into get off rule"; return; } ! 123, case 1 if (R == R_148) { print "standard exiting rule"; return; } ! 124, case 1 if (R == R_149) { print "standard report exiting rule"; return; } ! 125, case 1 if (R == R_150) { print "describe room emerged into rule"; return; } ! 126, case 1 if (R == R_151) { print "can't get off things rule"; return; } ! 127, case 1 if (R == R_152) { print "standard getting off rule"; return; } ! 128, case 1 if (R == R_153) { print "standard report getting off rule"; return; } ! 129, case 1 if (R == R_154) { print "describe room stood up into rule"; return; } ! 130, case 1 if (R == R_155) { print "determine visibility ceiling rule"; return; } ! 131, case 1 if (R == R_156) { print "room description heading rule"; return; } ! 132, case 1 if (R == R_157) { print "room description body text rule"; return; } ! 133, case 1 if (R == R_158) { print "room description paragraphs about objects rule"; return; } ! 134, case 1 if (R == R_159) { print "check new arrival rule"; return; } ! 135, case 1 if (R == R_160) { print "other people looking rule"; return; } ! 136, case 1 if (R == R_161) { print "examine undescribed containers rule"; return; } ! 137, case 1 if (R == R_162) { print "examine undescribed devices rule"; return; } ! 138, case 1 if (R == R_163) { print "examine undescribed things rule"; return; } ! 139, case 1 if (R == R_164) { print "examine directions rule"; return; } ! 140, case 1 if (R == R_165) { print "standard examining rule"; return; } ! 141, case 1 if (R == R_166) { print "examine described devices rule"; return; } ! 142, case 1 if (R == R_167) { print "report other people examining rule"; return; } ! 143, case 1 if (R == R_168) { print "standard looking under rule"; return; } ! 144, case 1 if (R == R_169) { print "report other people looking under rule"; return; } ! 145, case 1 if (R == R_170) { print "can't search unless container or supporter rule"; return; } ! 146, case 1 if (R == R_171) { print "can't search closed opaque containers rule"; return; } ! 147, case 1 if (R == R_172) { print "standard search containers rule"; return; } ! 148, case 1 if (R == R_173) { print "standard search supporters rule"; return; } ! 149, case 1 if (R == R_174) { print "report other people searching rule"; return; } ! 150, case 1 if (R == R_175) { print "block consulting rule"; return; } ! 151, case 1 if (R == R_176) { print "can't lock without a lock rule"; return; } ! 152, case 1 if (R == R_177) { print "can't lock what's already locked rule"; return; } ! 153, case 1 if (R == R_178) { print "can't lock what's open rule"; return; } ! 154, case 1 if (R == R_179) { print "can't lock without the correct key rule"; return; } ! 155, case 1 if (R == R_180) { print "standard locking rule"; return; } ! 156, case 1 if (R == R_181) { print "standard report locking rule"; return; } ! 157, case 1 if (R == R_182) { print "can't unlock without a lock rule"; return; } ! 158, case 1 if (R == R_183) { print "can't unlock what's already unlocked rule"; return; } ! 159, case 1 if (R == R_184) { print "can't unlock without the correct key rule"; return; } ! 160, case 1 if (R == R_185) { print "standard unlocking rule"; return; } ! 161, case 1 if (R == R_186) { print "standard report unlocking rule"; return; } ! 162, case 1 if (R == R_187) { print "can't switch on unless switchable rule"; return; } ! 163, case 1 if (R == R_188) { print "can't switch on what's already on rule"; return; } ! 164, case 1 if (R == R_189) { print "standard switching on rule"; return; } ! 165, case 1 if (R == R_190) { print "standard report switching on rule"; return; } ! 166, case 1 if (R == R_191) { print "can't switch off unless switchable rule"; return; } ! 167, case 1 if (R == R_192) { print "can't switch off what's already off rule"; return; } ! 168, case 1 if (R == R_193) { print "standard switching off rule"; return; } ! 169, case 1 if (R == R_194) { print "standard report switching off rule"; return; } ! 170, case 1 if (R == R_195) { print "can't open unless openable rule"; return; } ! 171, case 1 if (R == R_196) { print "can't open what's locked rule"; return; } ! 172, case 1 if (R == R_197) { print "can't open what's already open rule"; return; } ! 173, case 1 if (R == R_198) { print "standard opening rule"; return; } ! 174, case 1 if (R == R_199) { print "reveal any newly visible interior rule"; return; } ! 175, case 1 if (R == R_200) { print "standard report opening rule"; return; } ! 176, case 1 if (R == R_201) { print "can't close unless openable rule"; return; } ! 177, case 1 if (R == R_202) { print "can't close what's already closed rule"; return; } ! 178, case 1 if (R == R_203) { print "standard closing rule"; return; } ! 179, case 1 if (R == R_204) { print "standard report closing rule"; return; } ! 180, case 1 if (R == R_205) { print "can't wear what's not clothing rule"; return; } ! 181, case 1 if (R == R_206) { print "can't wear what's not held rule"; return; } ! 182, case 1 if (R == R_207) { print "can't wear what's already worn rule"; return; } ! 183, case 1 if (R == R_208) { print "standard wearing rule"; return; } ! 184, case 1 if (R == R_209) { print "standard report wearing rule"; return; } ! 185, case 1 if (R == R_210) { print "can't take off what's not worn rule"; return; } ! 186, case 1 if (R == R_211) { print "standard taking off rule"; return; } ! 187, case 1 if (R == R_212) { print "standard report taking off rule"; return; } ! 188, case 1 if (R == R_213) { print "can't give what you haven't got rule"; return; } ! 189, case 1 if (R == R_214) { print "can't give to yourself rule"; return; } ! 190, case 1 if (R == R_215) { print "can't give to a non-person rule"; return; } ! 191, case 1 if (R == R_216) { print "block giving rule"; return; } ! 192, case 1 if (R == R_217) { print "standard giving rule"; return; } ! 193, case 1 if (R == R_218) { print "standard report giving rule"; return; } ! 194, case 1 if (R == R_219) { print "can't show what you haven't got rule"; return; } ! 195, case 1 if (R == R_220) { print "convert show to yourself to examine rule"; return; } ! 196, case 1 if (R == R_221) { print "block showing rule"; return; } ! 197, case 1 if (R == R_222) { print "block waking rule"; return; } ! 198, case 1 if (R == R_223) { print "implicitly remove thrown clothing rule"; return; } ! 199, case 1 if (R == R_224) { print "futile to throw things at inanimate objects rule"; return; } ! 200, case 1 if (R == R_225) { print "block throwing at rule"; return; } ! 201, case 1 if (R == R_226) { print "block attacking rule"; return; } ! 202, case 1 if (R == R_227) { print "kissing yourself rule"; return; } ! 203, case 1 if (R == R_228) { print "block kissing rule"; return; } ! 204, case 1 if (R == R_229) { print "block answering rule"; return; } ! 205, case 1 if (R == R_230) { print "telling yourself rule"; return; } ! 206, case 1 if (R == R_231) { print "block telling rule"; return; } ! 207, case 1 if (R == R_232) { print "block asking rule"; return; } ! 208, case 1 if (R == R_233) { print "asking yourself for something rule"; return; } ! 209, case 1 if (R == R_234) { print "translate asking for to giving rule"; return; } ! 210, case 1 if (R == R_235) { print "standard report waiting rule"; return; } ! 211, case 1 if (R == R_236) { print "report touching yourself rule"; return; } ! 212, case 1 if (R == R_237) { print "report touching other people rule"; return; } ! 213, case 1 if (R == R_238) { print "report touching things rule"; return; } ! 214, case 1 if (R == R_239) { print "can't wave what's not held rule"; return; } ! 215, case 1 if (R == R_240) { print "report waving things rule"; return; } ! 216, case 1 if (R == R_241) { print "can't pull what's fixed in place rule"; return; } ! 217, case 1 if (R == R_242) { print "can't pull scenery rule"; return; } ! 218, case 1 if (R == R_243) { print "can't pull people rule"; return; } ! 219, case 1 if (R == R_244) { print "report pulling rule"; return; } ! 220, case 1 if (R == R_245) { print "can't push what's fixed in place rule"; return; } ! 221, case 1 if (R == R_246) { print "can't push scenery rule"; return; } ! 222, case 1 if (R == R_247) { print "can't push people rule"; return; } ! 223, case 1 if (R == R_248) { print "report pushing rule"; return; } ! 224, case 1 if (R == R_249) { print "can't turn what's fixed in place rule"; return; } ! 225, case 1 if (R == R_250) { print "can't turn scenery rule"; return; } ! 226, case 1 if (R == R_251) { print "can't turn people rule"; return; } ! 227, case 1 if (R == R_252) { print "report turning rule"; return; } ! 228, case 1 if (R == R_253) { print "can't push unpushable things rule"; return; } ! 229, case 1 if (R == R_254) { print "can't push to non-directions rule"; return; } ! 230, case 1 if (R == R_255) { print "can't push vertically rule"; return; } ! 231, case 1 if (R == R_256) { print "standard pushing in directions rule"; return; } ! 232, case 1 if (R == R_257) { print "block pushing in directions rule"; return; } ! 233, case 1 if (R == R_258) { print "innuendo about squeezing people rule"; return; } ! 234, case 1 if (R == R_259) { print "report squeezing rule"; return; } ! 235, case 1 if (R == R_260) { print "block saying yes rule"; return; } ! 236, case 1 if (R == R_261) { print "block saying no rule"; return; } ! 237, case 1 if (R == R_262) { print "block burning rule"; return; } ! 238, case 1 if (R == R_263) { print "block waking up rule"; return; } ! 239, case 1 if (R == R_264) { print "block thinking rule"; return; } ! 240, case 1 if (R == R_265) { print "block smelling rule"; return; } ! 241, case 1 if (R == R_266) { print "block listening rule"; return; } ! 242, case 1 if (R == R_267) { print "block tasting rule"; return; } ! 243, case 1 if (R == R_268) { print "block cutting rule"; return; } ! 244, case 1 if (R == R_269) { print "block jumping rule"; return; } ! 245, case 1 if (R == R_270) { print "block tying rule"; return; } ! 246, case 1 if (R == R_271) { print "block drinking rule"; return; } ! 247, case 1 if (R == R_272) { print "block saying sorry rule"; return; } ! 248, case 1 if (R == R_273) { print "block swearing obscenely rule"; return; } ! 249, case 1 if (R == R_274) { print "block swearing mildly rule"; return; } ! 250, case 1 if (R == R_275) { print "block swinging rule"; return; } ! 251, case 1 if (R == R_276) { print "block rubbing rule"; return; } ! 252, case 1 if (R == R_277) { print "block setting it to rule"; return; } ! 253, case 1 if (R == R_278) { print "block waving hands rule"; return; } ! 254, case 1 if (R == R_279) { print "block buying rule"; return; } ! 255, case 1 if (R == R_280) { print "block singing rule"; return; } ! 256, case 1 if (R == R_281) { print "block climbing rule"; return; } ! 257, case 1 if (R == R_282) { print "block sleeping rule"; return; } ! 258, case 1 if (R == R_826) { print "modify initiative based on combat results rule"; return; } ! 259, case 1 if (R == R_828) { print "defensive move bonus rule"; return; } ! 260, case 1 if (R == R_829) { print "counterattack extra damage rule"; return; } ! 261, case 1 if (R == R_830) { print "first combat round rule"; return; } ! 262, case 1 if (R == R_831) { print "begin the combat round rule"; return; } ! 263, case 1 if (R == R_839) { print "standard reset combat variables rule"; return; } ! 264, case 1 if (R == R_840) { print "standard attack roll rule"; return; } ! 265, case 1 if (R == R_841) { print "attack modifiers apply unless something intervenes rule"; return; } ! 266, case 1 if (R == R_842) { print "melee attack bonus rule"; return; } ! 267, case 1 if (R == R_843) { print "standard result of the attack roll rule"; return; } ! 268, case 1 if (R == R_844) { print "standard whether the attack hit rule"; return; } ! 269, case 1 if (R == R_845) { print "standard damage roll rule"; return; } ! 270, case 1 if (R == R_846) { print "basic final damage rule"; return; } ! 271, case 1 if (R == R_847) { print "standard printing-the-damage rule"; return; } ! 272, case 1 if (R == R_848) { print "basic no final damage rule"; return; } ! 273, case 1 if (R == R_850) { print "end reporting blow with paragraph break rule"; return; } ! 274, case 1 if (R == R_852) { print "basic non-fatal damage rule"; return; } ! 275, case 1 if (R == R_853) { print "basic fatal damage rule"; return; } ! 276, case 1 if (R == R_855) { print "only attack persons rule"; return; } ! 277, case 1 if (R == R_856) { print "only attack the living rule"; return; } ! 278, case 1 if (R == R_857) { print "do not attack friendly people rule"; return; } ! 279, case 1 if (R == R_858) { print "do not attack neutral people rule"; return; } ! 280, case 1 if (R == R_862) { print "concentration attack modifier rule"; return; } ! 281, case 1 if (R == R_863) { print "concentration damage modifier rule"; return; } ! 282, case 1 if (R == R_864) { print "lose concentration when hit rule"; return; } ! 283, case 1 if (R == R_865) { print "lose concentration after attacking rule"; return; } ! 284, case 1 if (R == R_868) { print "CTW concentration bonus rule"; return; } ! 285, case 1 if (R == R_870) { print "parry decreases to-hit rule"; return; } ! 286, case 1 if (R == R_871) { print "no longer at parry after attacking rule"; return; } ! 287, case 1 if (R == R_872) { print "CTW parry bonus rule"; return; } ! 288, case 1 if (R == R_874) { print "dodging defence bonus rule"; return; } ! 289, case 1 if (R == R_875) { print "dodging attack bonus rule"; return; } ! 290, case 1 if (R == R_876) { print "no longer at dodge after attacking rule"; return; } ! 291, case 1 if (R == R_877) { print "CTW dodge bonus rule"; return; } ! 292, case 1 if (R == R_882) { print "prefer targets you press rule"; return; } ! 293, case 1 if (R == R_883) { print "prefer those who press you rule"; return; } ! 294, case 1 if (R == R_884) { print "prefer the player rule"; return; } ! 295, case 1 if (R == R_885) { print "prefer the severely wounded rule"; return; } ! 296, case 1 if (R == R_886) { print "prefer concentrated people rule"; return; } ! 297, case 1 if (R == R_887) { print "prefer those with good weapons rule"; return; } ! 298, case 1 if (R == R_888) { print "do not prefer dodgers rule"; return; } ! 299, case 1 if (R == R_889) { print "do not prefer parrying rule"; return; } ! 300, case 1 if (R == R_890) { print "do not prefer high defence unless concentrated rule"; return; } ! 301, case 1 if (R == R_891) { print "randomise the target result rule"; return; } ! 302, case 1 if (R == R_893) { print "prefer lots of damage rule"; return; } ! 303, case 1 if (R == R_894) { print "prefer bad dodgability rule"; return; } ! 304, case 1 if (R == R_895) { print "prefer bad passive parry rule"; return; } ! 305, case 1 if (R == R_896) { print "prefer good active parry rule"; return; } ! 306, case 1 if (R == R_897) { print "prefer balanced parry and dodge rule"; return; } ! 307, case 1 if (R == R_898) { print "prefer good attack bonus rule"; return; } ! 308, case 1 if (R == R_899) { print "prefer readied weapon if attacker almost dead rule"; return; } ! 309, case 1 if (R == R_900) { print "prefer readied weapon if defender almost dead rule"; return; } ! 310, case 1 if (R == R_901) { print "slightly prefer readied weapon rule"; return; } ! 311, case 1 if (R == R_903) { print "consider attacking rule"; return; } ! 312, case 1 if (R == R_904) { print "consider concentrating rule"; return; } ! 313, case 1 if (R == R_905) { print "consider dodging rule"; return; } ! 314, case 1 if (R == R_906) { print "consider parrying rule"; return; } ! 315, case 1 if (R == R_907) { print "consider readying rule"; return; } ! 316, case 1 if (R == R_908) { print "consider reloading rule"; return; } ! 317, case 1 if (R == R_909) { print "calculate the chance to win rule"; return; } ! 318, case 1 if (R == R_910) { print "CTW default rule"; return; } ! 319, case 1 if (R == R_911) { print "CTW melee bonus rule"; return; } ! 320, case 1 if (R == R_912) { print "CTW defence bonus rule"; return; } ! 321, case 1 if (R == R_913) { print "CTW no greater than 10 rule"; return; } ! 322, case 1 if (R == R_914) { print "standard attack select rule"; return; } ! 323, case 1 if (R == R_915) { print "standard concentration select rule"; return; } ! 324, case 1 if (R == R_916) { print "concentration influences attacking rule"; return; } ! 325, case 1 if (R == R_917) { print "standard parry and dodge select rule"; return; } ! 326, case 1 if (R == R_918) { print "standard ready select rule"; return; } ! 327, case 1 if (R == R_919) { print "standard reloading select rule"; return; } ! 328, case 1 if (R == R_920) { print "randomise the action result rule"; return; } ! 329, case 1 if (R == R_922) { print "attack bonus from weapon rule"; return; } ! 330, case 1 if (R == R_923) { print "CTW attack bonus from weapon rule"; return; } ! 331, case 1 if (R == R_930) { print "ready natural weapons if no other weapon readied rule"; return; } ! 332, case 1 if (R == R_932) { print "basic flavour rule"; return; } ! 333, case 1 if (R == R_933) { print "basic player flavour rule"; return; } ! 334, case 1 if (R == R_934) { print "basic fatal flavour rule"; return; } ! 335, case 1 if (R == R_935) { print "basic attack move flavour rule"; return; } ! 336, case 1 if (R == R_938) { print "decrease ammo rule"; return; } ! 337, case 1 if (R == R_944) { print "do not prefer low ammo and long reload rule"; return; } ! 338, case 1 if (R == R_945) { print "do not chose an empty weapon that cannot be reloaded rule"; return; } ! 339, case 1 if (R == R_948) { print "consider charging rule"; return; } ! 340, case 1 if (R == R_969) { print "boar charge select rule"; return; } ! 341, case 1 if (R == R_970) { print "charge attack modifier rule"; return; } ! 342, case 1 if (R == R_971) { print "charge damage modifier rule"; return; } ! 343, case 1 if (R == LITTLE_USED_DO_NOTHING_R) { print "little-used do nothing rule"; return; } ! 774, case 1 if (R == VIRTUAL_MACHINE_STARTUP_R) { print "virtual machine startup rule"; return; } ! 775, case 1 if (R == INITIALISE_MEMORY_R) { print "initialise memory rule"; return; } ! 776, case 1 if (R == SEED_RANDOM_NUMBER_GENERATOR_R) { print "seed random number generator rule"; return; } ! 777, case 1 if (R == UPDATE_CHRONOLOGICAL_RECORDS_R) { print "update chronological records rule"; return; } ! 778, case 1 if (R == POSITION_PLAYER_IN_MODEL_R) { print "position player in model world rule"; return; } ! 779, case 1 if (R == ADJUST_LIGHT_R) { print "adjust light rule"; return; } ! 780, case 1 if (R == ADVANCE_TIME_R) { print "advance time rule"; return; } ! 781, case 1 if (R == GENERATE_ACTION_R) { print "generate action rule"; return; } ! 782, case 1 if (R == NOTE_OBJECT_ACQUISITIONS_R) { print "note object acquisitions rule"; return; } ! 783, case 1 if (R == PARSE_COMMAND_R) { print "parse command rule"; return; } ! 784, case 1 if (R == TIMED_EVENTS_R) { print "timed events rule"; return; } ! 785, case 1 if (R == RESURRECT_PLAYER_IF_ASKED_R) { print "resurrect player if asked rule"; return; } ! 786, case 1 if (R == ASK_FINAL_QUESTION_R) { print "ask the final question rule"; return; } ! 787, case 1 if (R == DetectSceneChange) { print "scene change machinery rule"; return; } ! 788, case 1 if (R == BASIC_ACCESSIBILITY_R) { print "basic accessibility rule"; return; } ! 789, case 1 if (R == BASIC_VISIBILITY_R) { print "basic visibility rule"; return; } ! 790, case 1 if (R == CARRYING_REQUIREMENTS_R) { print "carrying requirements rule"; return; } ! 791, case 1 if (R == REQUESTED_ACTIONS_REQUIRE_R) { print "requested actions require persuasion rule"; return; } ! 792, case 1 if (R == CARRY_OUT_REQUESTED_ACTIONS_R) { print "carry out requested actions rule"; return; } ! 793, case 1 if (R == DESCEND_TO_SPECIFIC_ACTION_R) { print "descend to specific action-processing rule"; return; } ! 794, case 1 if (R == WORK_OUT_DETAILS_OF_SPECIFIC_R) { print "work out details of specific action rule"; return; } ! 795, case 1 if (R == ACCESS_THROUGH_BARRIERS_R) { print "access through barriers rule"; return; } ! 796, case 1 if (R == CANT_REACH_INSIDE_CLOSED_R) { print "can't reach inside closed containers rule"; return; } ! 797, case 1 if (R == CANT_REACH_INSIDE_ROOMS_R) { print "can't reach inside rooms rule"; return; } ! 798, case 1 if (R == CANT_REACH_OUTSIDE_CLOSED_R) { print "can't reach outside closed containers rule"; return; } ! 799, case 1 if (R == STANDARD_NAME_PRINTING_R) { print "standard name printing rule"; return; } ! 800, case 1 if (R == STANDARD_CONTENTS_LISTING_R) { print "standard contents listing rule"; return; } ! 801, case 1 if (R == ENABLE_GLULX_ACCEL_R) { print "enable Glulx acceleration rule"; return; } ! 802, case 1 if (R == PRINT_OBITUARY_HEADLINE_R) { print "print obituary headline rule"; return; } ! 803, case 1 if (R == PRINT_FINAL_SCORE_R) { print "print final score rule"; return; } ! 804, case 1 if (R == DISPLAY_FINAL_STATUS_LINE_R) { print "display final status line rule"; return; } ! 805, case 1 if (R == IMMEDIATELY_RESTART_VM_R) { print "immediately restart the VM rule"; return; } ! 806, case 1 if (R == IMMEDIATELY_RESTORE_SAVED_R) { print "immediately restore saved game rule"; return; } ! 807, case 1 if (R == IMMEDIATELY_QUIT_R) { print "immediately quit rule"; return; } ! 808, case 1 if (R == IMMEDIATELY_UNDO_R) { print "immediately undo rule"; return; } ! 809, case 1 if (R == READ_FINAL_ANSWER_R) { print "read the final answer rule"; return; } ! 810, case 1 if (R == QUIT_THE_GAME_R) { print "quit the game rule"; return; } ! 811, case 1 if (R == SAVE_THE_GAME_R) { print "save the game rule"; return; } ! 812, case 1 if (R == RESTORE_THE_GAME_R) { print "restore the game rule"; return; } ! 813, case 1 if (R == RESTART_THE_GAME_R) { print "restart the game rule"; return; } ! 814, case 1 if (R == VERIFY_THE_STORY_FILE_R) { print "verify the story file rule"; return; } ! 815, case 1 if (R == SWITCH_TRANSCRIPT_ON_R) { print "switch the story transcript on rule"; return; } ! 816, case 1 if (R == SWITCH_TRANSCRIPT_OFF_R) { print "switch the story transcript off rule"; return; } ! 817, case 1 if (R == ANNOUNCE_STORY_FILE_VERSION_R) { print "announce the story file version rule"; return; } ! 818, case 1 if (R == ANNOUNCE_SCORE_R) { print "announce the score rule"; return; } ! 819, case 1 if (R == PREFER_ABBREVIATED_R) { print "prefer abbreviated room descriptions rule"; return; } ! 820, case 1 if (R == REP_PREFER_ABBREVIATED_R) { print "standard report preferring abbreviated room descriptions rule"; return; } ! 821, case 1 if (R == PREFER_UNABBREVIATED_R) { print "prefer unabbreviated room descriptions rule"; return; } ! 822, case 1 if (R == REP_PREFER_UNABBREVIATED_R) { print "standard report preferring unabbreviated room descriptions rule"; return; } ! 823, case 1 if (R == PREFER_SOMETIMES_ABBREVIATED_R) { print "prefer sometimes abbreviated room descriptions rule"; return; } ! 824, case 1 if (R == REP_PREFER_SOMETIMES_ABBR_R) { print "standard report preferring sometimes abbreviated room descriptions rule"; return; } ! 825, case 1 if (R == SWITCH_SCORE_NOTIFY_ON_R) { print "switch score notification on rule"; return; } ! 826, case 1 if (R == REP_SWITCH_NOTIFY_ON_R) { print "standard report switching score notification on rule"; return; } ! 827, case 1 if (R == SWITCH_SCORE_NOTIFY_OFF_R) { print "switch score notification off rule"; return; } ! 828, case 1 if (R == REP_SWITCH_NOTIFY_OFF_R) { print "standard report switching score notification off rule"; return; } ! 829, case 1 if (R == ANNOUNCE_PRONOUN_MEANINGS_R) { print "announce the pronoun meanings rule"; return; } ! 830, case 1 if (R == R_11) { print "A first turn sequence rule"; return; } ! 831, case 2 if (R == R_12) { print "A last turn sequence rule"; return; } ! 832, case 2 if (R == R_27) { print "last specific action-processing rule"; return; } ! 833, case 2 if (R == R_143) { print "Setting action variables for exiting"; return; } ! 834, case 2 if (R == R_708) { print "Carry out finding responses to"; return; } ! 835, case 2 if (R == R_714) { print "Carry out giving text for"; return; } ! 836, case 2 if (R == R_715) { print "Carry out giving link to"; return; } ! 837, case 2 if (R == R_716) { print "Carry out preparing"; return; } ! 838, case 2 if (R == R_717) { print "Instead of giving text for no quip chosen"; return; } ! 839, case 2 if (R == R_720) { print "When play begins"; return; } ! 840, case 2 if (R == R_740) { print "When play begins"; return; } ! 841, case 2 if (R == R_741) { print "Rule for deciding whether all includes scenery"; return; } ! 842, case 2 if (R == R_742) { print "Rule for deciding whether all includes persons"; return; } ! 843, case 2 if (R == R_743) { print "Instead of examining here-backdrop"; return; } ! 844, case 2 if (R == R_753) { print "After printing the name of something ( called the target )"; return; } ! 845, case 2 if (R == R_794) { print "Every turn"; return; } ! 846, case 2 if (R == R_795) { print "After printing the name of an ambiguously plural thing ( called the suspect )"; return; } ! 847, case 2 if (R == R_799) { print "When play begins"; return; } ! 848, case 2 if (R == R_801) { print "Before behaving randomly"; return; } ! 849, case 2 if (R == R_804) { print "Before doing anything"; return; } ! 850, case 2 if (R == R_805) { print "When play begins"; return; } ! 851, case 2 if (R == R_807) { print "Carry out switching the numbers off"; return; } ! 852, case 2 if (R == R_808) { print "Carry out switching the numbers on"; return; } ! 853, case 2 if (R == R_811) { print "Rule for printing the name of yourself"; return; } ! 854, case 2 if (R == R_817) { print "First turn sequence rule"; return; } ! 855, case 2 if (R == R_821) { print "When play begins"; return; } ! 856, case 2 if (R == R_824) { print "When play begins"; return; } ! 857, case 2 if (R == R_827) { print "Carry out an actor waiting"; return; } ! 858, case 2 if (R == R_833) { print "Last turn sequence rule"; return; } ! 859, case 2 if (R == R_836) { print "Every turn"; return; } ! 860, case 2 if (R == R_849) { print "First print flavour text rule"; return; } ! 861, case 2 if (R == R_859) { print "Carry out an actor attacking when the fight consequences variable is false"; return; } ! 862, case 2 if (R == R_860) { print "Carry out an actor attacking when the fight consequences variable is true"; return; } ! 863, case 2 if (R == R_861) { print "Carry out an actor concentrating"; return; } ! 864, case 2 if (R == R_869) { print "Carry out an actor parrying"; return; } ! 865, case 2 if (R == R_873) { print "Carry out an actor dodging"; return; } ! 866, case 2 if (R == R_921) { print "A standard_attacker rule"; return; } ! 867, case 2 if (R == R_924) { print "Carry out an actor readying"; return; } ! 868, case 2 if (R == R_925) { print "After printing the name of a readied weapon while taking inventory"; return; } ! 869, case 2 if (R == R_926) { print "After dropping a readied weapon"; return; } ! 870, case 2 if (R == R_927) { print "After putting on a readied weapon"; return; } ! 871, case 2 if (R == R_928) { print "After inserting into a readied weapon"; return; } ! 872, case 2 if (R == R_929) { print "Instead of examining a natural weapon"; return; } ! 873, case 2 if (R == R_931) { print "A print flavour text rule"; return; } ! 874, case 2 if (R == R_937) { print "After printing the name of a weapon ( called item ) when taking inventory"; return; } ! 875, case 2 if (R == R_939) { print "Check attacking"; return; } ! 876, case 2 if (R == R_940) { print "Does the player mean reloading an unloaded readied weapon enclosed by the player"; return; } ! 877, case 2 if (R == R_941) { print "Does the player mean reloading an unloaded weapon enclosed by the player"; return; } ! 878, case 2 if (R == R_942) { print "Check reloading"; return; } ! 879, case 2 if (R == R_943) { print "Carry out an actor reloading"; return; } ! 880, case 2 if (R == R_946) { print "Instead of examining a spear"; return; } ! 881, case 2 if (R == R_949) { print "Carry out an actor charging"; return; } ! 882, case 2 if (R == R_950) { print "Instead of examining the chorus for the first time"; return; } ! 883, case 2 if (R == R_951) { print "Instead of examining the chorus"; return; } ! 884, case 2 if (R == R_952) { print "Instead of examining your sword"; return; } ! 885, case 2 if (R == R_953) { print "Check going south from your room"; return; } ! 886, case 2 if (R == R_954) { print "Instead of giving text for set_values_1"; return; } ! 887, case 2 if (R == R_955) { print "Instead of finding responses to set_values_1"; return; } ! 888, case 2 if (R == R_956) { print "Instead of giving link to set_values_2"; return; } ! 889, case 2 if (R == R_957) { print "Instead of giving text for set_values_2"; return; } ! 890, case 2 if (R == R_958) { print "Instead of finding responses to set_values_2"; return; } ! 891, case 2 if (R == R_959) { print "Instead of giving link to set_values_3"; return; } ! 892, case 2 if (R == R_960) { print "Instead of giving text for set_values_3"; return; } ! 893, case 2 if (R == R_961) { print "Instead of finding responses to set_values_3"; return; } ! 894, case 2 if (R == R_962) { print "Instead of giving link to set_values_4"; return; } ! 895, case 2 if (R == R_963) { print "Instead of giving text for set_values_4"; return; } ! 896, case 2 if (R == R_964) { print "Instead of finding responses to set_values_4"; return; } ! 897, case 2 if (R == R_965) { print "Instead of giving link to set_values_5"; return; } ! 898, case 2 if (R == R_966) { print "Instead of giving text for set_values_5"; return; } ! 899, case 2 if (R == R_967) { print "Instead of giving link to set_values_6"; return; } ! 900, case 2 if (R == R_968) { print "Instead of giving text for set_values_6"; return; } ! 901, case 2 if (R == R_5) { print "start in the correct scenes rule"; return; } ! 902, case 1 if (R == POSITION_PLAYER_IN_MODEL_R) { print "position player in model world rule"; return; } ! 903, case 1 if (R == UPDATE_CHRONOLOGICAL_RECORDS_R) { print "update chronological records rule"; return; } ! 904, case 1 if (R == SEED_RANDOM_NUMBER_GENERATOR_R) { print "seed random number generator rule"; return; } ! 905, case 1 if (R == INITIALISE_MEMORY_R) { print "initialise memory rule"; return; } ! 906, case 1 if (R == VIRTUAL_MACHINE_STARTUP_R) { print "virtual machine startup rule"; return; } ! 907, case 1 if (R == R_6) { print "when play begins stage rule"; return; } ! 908, case 1 if (R == R_7) { print "fix baseline scoring rule"; return; } ! 909, case 1 if (R == R_8) { print "display banner rule"; return; } ! 910, case 1 if (R == R_9) { print "initial room description rule"; return; } ! 911, case 1 if (R == GENERATE_ACTION_R) { print "generate action rule"; return; } ! 912, case 1 if (R == PARSE_COMMAND_R) { print "parse command rule"; return; } ! 913, case 1 if (R == TIMED_EVENTS_R) { print "timed events rule"; return; } ! 914, case 1 if (R == ADVANCE_TIME_R) { print "advance time rule"; return; } ! 915, case 1 if (R == UPDATE_CHRONOLOGICAL_RECORDS_R) { print "update chronological records rule"; return; } ! 916, case 1 if (R == ADJUST_LIGHT_R) { print "adjust light rule"; return; } ! 917, case 1 if (R == NOTE_OBJECT_ACQUISITIONS_R) { print "note object acquisitions rule"; return; } ! 918, case 1 if (R == R_13) { print "notify score changes rule"; return; } ! 919, case 1 if (R == R_14) { print "when play ends stage rule"; return; } ! 920, case 1 if (R == RESURRECT_PLAYER_IF_ASKED_R) { print "resurrect player if asked rule"; return; } ! 921, case 1 if (R == R_15) { print "print player's obituary rule"; return; } ! 922, case 1 if (R == ASK_FINAL_QUESTION_R) { print "ask the final question rule"; return; } ! 923, case 1 if (R == DetectSceneChange) { print "scene change machinery rule"; return; } ! 924, case 1 if (R == R_18) { print "before stage rule"; return; } ! 925, case 1 if (R == R_16) { print "set pronouns from items from multiple object lists rule"; return; } ! 926, case 1 if (R == R_17) { print "announce items from multiple object lists rule"; return; } ! 927, case 1 if (R == BASIC_VISIBILITY_R) { print "basic visibility rule"; return; } ! 928, case 1 if (R == BASIC_ACCESSIBILITY_R) { print "basic accessibility rule"; return; } ! 929, case 1 if (R == CARRYING_REQUIREMENTS_R) { print "carrying requirements rule"; return; } ! 930, case 1 if (R == R_19) { print "instead stage rule"; return; } ! 931, case 1 if (R == REQUESTED_ACTIONS_REQUIRE_R) { print "requested actions require persuasion rule"; return; } ! 932, case 1 if (R == CARRY_OUT_REQUESTED_ACTIONS_R) { print "carry out requested actions rule"; return; } ! 933, case 1 if (R == DESCEND_TO_SPECIFIC_ACTION_R) { print "descend to specific action-processing rule"; return; } ! 934, case 1 if (R == R_20) { print "end action-processing in success rule"; return; } ! 935, case 1 if (R == WORK_OUT_DETAILS_OF_SPECIFIC_R) { print "work out details of specific action rule"; return; } ! 936, case 1 if (R == ACCESS_THROUGH_BARRIERS_R) { print "access through barriers rule"; return; } ! 937, case 1 if (R == CANT_REACH_INSIDE_ROOMS_R) { print "can't reach inside rooms rule"; return; } ! 938, case 1 if (R == CANT_REACH_INSIDE_CLOSED_R) { print "can't reach inside closed containers rule"; return; } ! 939, case 1 if (R == CANT_REACH_OUTSIDE_CLOSED_R) { print "can't reach outside closed containers rule"; return; } ! 940, case 1 if (R == R_32) { print "can't act in the dark rule"; return; } ! 941, case 1 if (R == STANDARD_NAME_PRINTING_R) { print "standard name printing rule"; return; } ! 942, case 1 if (R == R_47) { print "standard printing the plural name rule"; return; } ! 943, case 1 if (R == R_48) { print "standard printing a number of something rule"; return; } ! 944, case 1 if (R == STANDARD_CONTENTS_LISTING_R) { print "standard contents listing rule"; return; } ! 945, case 1 if (R == R_49) { print "look around once light available rule"; return; } ! 946, case 1 if (R == ENABLE_GLULX_ACCEL_R) { print "enable Glulx acceleration rule"; return; } ! 947, case 1 if (R == PRINT_OBITUARY_HEADLINE_R) { print "print obituary headline rule"; return; } ! 948, case 1 if (R == PRINT_FINAL_SCORE_R) { print "print final score rule"; return; } ! 949, case 1 if (R == DISPLAY_FINAL_STATUS_LINE_R) { print "display final status line rule"; return; } ! 950, case 1 if (R == R_54) { print "print the final question rule"; return; } ! 951, case 1 if (R == R_53) { print "print the final prompt rule"; return; } ! 952, case 1 if (R == READ_FINAL_ANSWER_R) { print "read the final answer rule"; return; } ! 953, case 1 if (R == R_55) { print "standard respond to final question rule"; return; } ! 954, case 1 if (R == R_77) { print "can't take component parts rule"; return; } ! 955, case 1 if (R == QUIT_THE_GAME_R) { print "quit the game rule"; return; } ! 956, case 1 if (R == SAVE_THE_GAME_R) { print "save the game rule"; return; } ! 957, case 1 if (R == RESTORE_THE_GAME_R) { print "restore the game rule"; return; } ! 958, case 1 if (R == RESTART_THE_GAME_R) { print "restart the game rule"; return; } ! 959, case 1 if (R == VERIFY_THE_STORY_FILE_R) { print "verify the story file rule"; return; } ! 960, case 1 if (R == SWITCH_TRANSCRIPT_ON_R) { print "switch the story transcript on rule"; return; } ! 961, case 1 if (R == SWITCH_TRANSCRIPT_OFF_R) { print "switch the story transcript off rule"; return; } ! 962, case 1 if (R == ANNOUNCE_STORY_FILE_VERSION_R) { print "announce the story file version rule"; return; } ! 963, case 1 if (R == ANNOUNCE_SCORE_R) { print "announce the score rule"; return; } ! 964, case 1 if (R == PREFER_ABBREVIATED_R) { print "prefer abbreviated room descriptions rule"; return; } ! 965, case 1 if (R == REP_PREFER_ABBREVIATED_R) { print "standard report preferring abbreviated room descriptions rule"; return; } ! 966, case 1 if (R == PREFER_UNABBREVIATED_R) { print "prefer unabbreviated room descriptions rule"; return; } ! 967, case 1 if (R == REP_PREFER_UNABBREVIATED_R) { print "standard report preferring unabbreviated room descriptions rule"; return; } ! 968, case 1 if (R == PREFER_SOMETIMES_ABBREVIATED_R) { print "prefer sometimes abbreviated room descriptions rule"; return; } ! 969, case 1 if (R == REP_PREFER_SOMETIMES_ABBR_R) { print "standard report preferring sometimes abbreviated room descriptions rule"; return; } ! 970, case 1 if (R == SWITCH_SCORE_NOTIFY_ON_R) { print "switch score notification on rule"; return; } ! 971, case 1 if (R == REP_SWITCH_NOTIFY_ON_R) { print "standard report switching score notification on rule"; return; } ! 972, case 1 if (R == SWITCH_SCORE_NOTIFY_OFF_R) { print "switch score notification off rule"; return; } ! 973, case 1 if (R == REP_SWITCH_NOTIFY_OFF_R) { print "standard report switching score notification off rule"; return; } ! 974, case 1 if (R == ANNOUNCE_PRONOUN_MEANINGS_R) { print "announce the pronoun meanings rule"; return; } ! 975, case 1 if (R == R_930) { print "ready natural weapons if no other weapon readied rule"; return; } ! 976, case 1 print "(nameless rule at address ", R, ")"; } #ifnot; if ((R>=0) && (R 0) { ExchangeFields(i, j); f = true; break; } } ]; [ InsertionSortAlgorithm from to i j; if (to > from+1) { for (i = from+1: i < to: i++) { for (j = i: j > from: j--) { if (CompareFields(j, j-1) < 0) ExchangeFields(j, j-1); else break; } } } ]; [ InPlaceMergeSortAlgorithm from to middle; if (to - from < 12) { if (to - from < 2) return; InsertionSortAlgorithm(from, to); return; } middle = (from + to)/2; InPlaceMergeSortAlgorithm(from, middle); InPlaceMergeSortAlgorithm(middle, to); IPMS_Merge(from, middle, to, middle-from, to - middle); ]; [ IPMS_Lower from to val len half mid; len = to - from; while (len > 0) { half = len/2; mid = from + half; if (CompareFields(mid, val) < 0) { from = mid + 1; len = len - half -1; } else len = half; } return from; ]; [ IPMS_Upper from to val len half mid; len = to - from; while (len > 0) { half = len/2; mid = from + half; if (CompareFields(val, mid) < 0) len = half; else { from = mid + 1; len = len - half -1; } } return from; ]; [ IPMS_Reverse from to; while (from < to) { ExchangeFields(from++, to--); } ]; [ IPMS_Rotate from mid to n val shift p1 p2; if ((from==mid) || (mid==to)) return; IPMS_Reverse(from, mid-1); IPMS_Reverse(mid, to-1); IPMS_Reverse(from, to-1); ]; [ IPMS_Merge from pivot to len1 len2 first_cut second_cut len11 len22 new_mid; if ((len1 == 0) || (len2 == 0)) return; if (len1+len2 == 2) { if (CompareFields(pivot, from) < 0) ExchangeFields(pivot, from); return; } if (len1 > len2) { len11 = len1/2; first_cut = from + len11; second_cut = IPMS_Lower(pivot, to, first_cut); len22 = second_cut - pivot; } else { len22 = len2/2; second_cut = pivot + len22; first_cut = IPMS_Upper(from, pivot, second_cut); len11 = first_cut - from; } IPMS_Rotate(first_cut, pivot, second_cut); new_mid = first_cut + len22; IPMS_Merge(from, first_cut, new_mid, len11, len22); IPMS_Merge(new_mid, second_cut, to, len1 - len11, len2 - len22); ]; Constant TB_COLUMN_SIGNED $4000; Constant TB_COLUMN_TOPIC $2000; Constant TB_COLUMN_DONTSORTME $1000; Constant TB_COLUMN_NOBLANKBITS $0800; Constant TB_COLUMN_CANEXCHANGE $0400; Constant TB_COLUMN_ALLOCATED $0200; Constant TB_COLUMN_NUMBER $01ff; ! Mask to remove upper bit flags Constant COL_HSIZE 2; ! Column header size: two words (ID/flags, blank bits) [ TableFindCol tab col f i no_cols n; no_cols = tab-->0; for (i=1: i<=no_cols: i++) if (col == ((tab-->i)-->1) & TB_COLUMN_NUMBER) return i; if (f) { RunTimeProblem(RTP_TABLE_NOCOL, tab); return 0; } return 0; ]; [ TableRows tab; return ((tab-->1)-->0) - COL_HSIZE; ]; Constant TABLE_NOVALUE = IMPROBABLE_VALUE; Array CheckTableEntryIsBlank_LU -> $$00000001 $$00000010 $$00000100 $$00001000 $$00010000 $$00100000 $$01000000 $$10000000; Array CheckTableEntryIsNonBlank_LU -> $$11111110 $$11111101 $$11111011 $$11110111 $$11101111 $$11011111 $$10111111 $$01111111; [ CheckTableEntryIsBlank tab col row i at; if (col >= 100) col = TableFindCol(tab, col); if (col == 0) rtrue; if ((tab-->col)-->(row+COL_HSIZE) ~= TABLE_NOVALUE) { print "*** CTEIB on nonblank value ", tab, " ", col, " ", row, " ***^"; } if (((tab-->col)-->1) & TB_COLUMN_NOBLANKBITS) rtrue; row--; at = ((tab-->col)-->2) + (row/8); if ((TB_Blanks->at) & (CheckTableEntryIsBlank_LU->(row%8))) rtrue; rfalse; ]; [ ForceTableEntryBlank tab col row i at oldv flags; if (col >= 100) col = TableFindCol(tab, col); if (col == 0) rtrue; flags = (tab-->col)-->1; oldv = (tab-->col)-->(row+COL_HSIZE); if ((flags & TB_COLUMN_ALLOCATED) && (oldv ~= 0 or TABLE_NOVALUE)) BlkFree(oldv); (tab-->col)-->(row+COL_HSIZE) = TABLE_NOVALUE; if (flags & TB_COLUMN_NOBLANKBITS) return; row--; at = ((tab-->col)-->2) + (row/8); (TB_Blanks->at) = (TB_Blanks->at) | (CheckTableEntryIsBlank_LU->(row%8)); ]; [ ForceTableEntryNonBlank tab col row i at oldv flags tc kov j; if (col >= 100) col=TableFindCol(tab, col); if (col == 0) rtrue; if (((tab-->col)-->1) & TB_COLUMN_NOBLANKBITS) return; flags = (tab-->col)-->1; oldv = (tab-->col)-->(row+COL_HSIZE); if ((flags & TB_COLUMN_ALLOCATED) && (oldv == 0 or TABLE_NOVALUE)) { kov = UNKNOWN_TY; tc = ((tab-->col)-->1) & TB_COLUMN_NUMBER; for (j=0: TC_KOVs-->j: j=j+3) if (TC_KOVs-->j == tc) { kov = TC_KOVs-->(j+1); break; } if (kov ~= UNKNOWN_TY) (tab-->col)-->(row+COL_HSIZE) = BlkValueCreate(kov, 0, TC_KOVs-->(j+2)); } row--; at = ((tab-->col)-->2) + (row/8); (TB_Blanks->at) = (TB_Blanks->at) & (CheckTableEntryIsNonBlank_LU->(row%8)); ]; [ TableSwapBlankBits tab row1 row2 col at1 at2 bit1 bit2; if (col >= 100) col=TableFindCol(tab, col); if (col == 0) rtrue; if (((tab-->col)-->1) & TB_COLUMN_NOBLANKBITS) return; row1--; at1 = ((tab-->col)-->2) + (row1/8); row2--; at2 = ((tab-->col)-->2) + (row2/8); bit1 = ((TB_Blanks->at1) & (CheckTableEntryIsBlank_LU->(row1%8))); bit2 = ((TB_Blanks->at2) & (CheckTableEntryIsBlank_LU->(row2%8))); if (bit1) bit1 = true; if (bit2) bit2 = true; if (bit1 == bit2) return; if (bit1) { (TB_Blanks->at1) = (TB_Blanks->at1) & (CheckTableEntryIsNonBlank_LU->(row1%8)); (TB_Blanks->at2) = (TB_Blanks->at2) | (CheckTableEntryIsBlank_LU->(row2%8)); } else { (TB_Blanks->at1) = (TB_Blanks->at1) | (CheckTableEntryIsBlank_LU->(row1%8)); (TB_Blanks->at2) = (TB_Blanks->at2) & (CheckTableEntryIsNonBlank_LU->(row2%8)); } ]; [ TableMoveBlankBitsDown tab row1 row2 col at atp1 bit rx; if (col >= 100) col=TableFindCol(tab, col); if (col == 0) rtrue; if (((tab-->col)-->1) & TB_COLUMN_NOBLANKBITS) return; row1--; row2--; ! Read blank bit for row1: at = ((tab-->col)-->2) + (row1/8); bit = ((TB_Blanks->at) & (CheckTableEntryIsBlank_LU->(row1%8))); if (bit) bit = true; ! Loop through, setting each blank bit to the next: for (rx=row1:rxcol)-->2) + ((rx+1)/8); at = ((tab-->col)-->2) + (rx/8); if ((TB_Blanks->atp1) & (CheckTableEntryIsBlank_LU->((rx+1)%8))) { (TB_Blanks->at) = (TB_Blanks->at) | (CheckTableEntryIsBlank_LU->(rx%8)); } else { (TB_Blanks->at) = (TB_Blanks->at) & (CheckTableEntryIsNonBlank_LU->(rx%8)); } } ! Write bit to blank bit for row2: at = ((tab-->col)-->2) + (row2/8); if (bit) { (TB_Blanks->at) = (TB_Blanks->at) | (CheckTableEntryIsBlank_LU->(row2%8)); } else { (TB_Blanks->at) = (TB_Blanks->at) & (CheckTableEntryIsNonBlank_LU->(row2%8)); } ]; [ TableRowCorr tab col lookup_value lookup_col i j f; if (col >= 100) col=TableFindCol(tab, col, true); lookup_col = tab-->col; j = lookup_col-->0 - COL_HSIZE; f=0; if (((tab-->col)-->1) & TB_COLUMN_ALLOCATED) f=1; for (i=1:i<=j:i++) { if ((lookup_value == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,i))) continue; if (f) { if (BlkValueCompare(lookup_col-->(i+COL_HSIZE), lookup_value) == 0) return i; } else { if (lookup_col-->(i+COL_HSIZE) == lookup_value) return i; } } return RunTimeProblem(RTP_TABLE_NOCORR, tab); ]; [ ExistsTableRowCorr tab col entry i k v f kov; if (col >= 100) col=TableFindCol(tab, col); if (col == 0) rfalse; f=0; if (((tab-->col)-->1) & TB_COLUMN_TOPIC) f=1; else if (((tab-->col)-->1) & TB_COLUMN_ALLOCATED) f=2; k = TableRows(tab); for (i=1:i<=k:i++) { ! print "Checking row ", i, "^"; v = (tab-->col)-->(i+COL_HSIZE); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,i))) continue; switch (f) { 1: if ((v)(entry/100, entry%100) ~= GPR_FAIL) return i; 2: if (BlkValueCompare(v, entry) == 0) return i; default: if (v == entry) return i; } } ! print "Giving up^"; return 0; ]; [ TableLookUpCorr tab col1 col2 lookup_value write_flag write_value cola1 cola2 i j v f; if (col1 >= 100) col1=TableFindCol(tab, col1, true); if (col2 >= 100) col2=TableFindCol(tab, col2, true); cola1 = tab-->col1; cola2 = tab-->col2; j = cola2-->0; f=0; if (((tab-->col2)-->1) & TB_COLUMN_ALLOCATED) f=1; for (i=1+COL_HSIZE:i<=j:i++) { if (f) { if (BlkValueCompare(cola2-->i, lookup_value) ~= 0) continue; } else { if (cola2-->i ~= lookup_value) continue; } if (write_flag) { ForceTableEntryNonBlank(tab,col1,i-COL_HSIZE); cola1-->i = write_value; rfalse; } v = cola1-->i; if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col1,i-COL_HSIZE))) continue; return v; } return RunTimeProblem(RTP_TABLE_NOCORR, tab); ]; [ ExistsTableLookUpCorr tab col1 col2 lookup_value cola1 cola2 i j f; if (col1 >= 100) col1=TableFindCol(tab, col1, false); if (col2 >= 100) col2=TableFindCol(tab, col2, false); if (col1*col2 == 0) rfalse; cola1 = tab-->col1; cola2 = tab-->col2; j = cola2-->0; f=0; if (((tab-->col2)-->1) & TB_COLUMN_ALLOCATED) f=1; for (i=1+COL_HSIZE:i<=j:i++) { if (f) { if (BlkValueCompare(cola2-->i, lookup_value) ~= 0) continue; } else { if (cola2-->i ~= lookup_value) continue; } if ((cola1-->i == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col1,i-COL_HSIZE))) continue; rtrue; } rfalse; ]; [ TableLookUpEntry tab col index write_flag write_value v; if (col >= 100) col=TableFindCol(tab, col, true); if ((index < 1) || (index > TableRows(tab))) return RunTimeProblem(RTP_TABLE_NOROW, tab, index); if (write_flag) { switch(write_flag) { 1: ForceTableEntryNonBlank(tab,col,index); (tab-->col)-->(index+COL_HSIZE) = write_value; 2: ForceTableEntryNonBlank(tab,col,index); (tab-->col)-->(index+COL_HSIZE) = ((tab-->col)-->(index+COL_HSIZE)) + write_value; 3: ForceTableEntryNonBlank(tab,col,index); (tab-->col)-->(index+COL_HSIZE) = ((tab-->col)-->(index+COL_HSIZE)) - write_value; 4: ForceTableEntryBlank(tab,col,index); 5: ForceTableEntryNonBlank(tab,col,index); return ((tab-->col)-->(index+COL_HSIZE)); } rfalse; } v = ((tab-->col)-->(index+COL_HSIZE)); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,index))) return RunTimeProblem(RTP_TABLE_NOENTRY, tab, col, index); return v; ]; [ ExistsTableLookUpEntry tab col index v; if (col >= 100) col=TableFindCol(tab, col); if (col == 0) rfalse; if ((index<1) || (index > TableRows(tab))) rfalse; v = ((tab-->col)-->(index+COL_HSIZE)); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,index))) rfalse; rtrue; ]; [ TableRowIsBlank tab j k; for (k=1:k<=tab-->0:k++) { if (((tab-->k)-->(j+COL_HSIZE)) ~= TABLE_NOVALUE) rfalse; if (CheckTableEntryIsBlank(tab, k, j) == false) rfalse; } rtrue; ]; [ TableBlankOutRow tab j k; if (tab==0) return RunTimeProblem(RTP_TABLE_NOTABLE, tab); for (k=1:k<=tab-->0:k++) ForceTableEntryBlank(tab, k, j); ]; [ TableBlankRows tab i j c; i = TableRows(tab); !print i, " rows^"; for (j=1:j<=i:j++) if (TableRowIsBlank(tab, j)) c++; !print c, " blank^"; return c; ]; [ TableFilledRows tab; return TableRows(tab) - TableBlankRows(tab); ]; [ TableBlankRow tab i j; i = TableRows(tab); for (j=1:j<=i:j++) if (TableRowIsBlank(tab, j)) return j; RunTimeProblem(RTP_TABLE_NOMOREBLANKS, tab); return i; ]; [ TableRandomRow tab i j k; i = TableRows(tab); j = TableFilledRows(tab); if (j==0) return RunTimeProblem(RTP_TABLE_NOROWS, tab); if (j>1) j = random(j); for (k=1:k<=i:k++) { if (TableRowIsBlank(tab, k) == false) j--; if (j==0) return k; } ]; [ TableSwapRows tab i j k l v1 v2; if (i==j) return; l = tab-->0; for (k=1:k<=l:k++) { v1 = (tab-->k)-->(i+COL_HSIZE); v2 = (tab-->k)-->(j+COL_HSIZE); (tab-->k)-->(i+COL_HSIZE) = v2; (tab-->k)-->(j+COL_HSIZE) = v1; if ((v1 == TABLE_NOVALUE) || (v2 == TABLE_NOVALUE)) TableSwapBlankBits(tab, i, j, k); } ]; [ TableCompareRows tab col row1 row2 dir val1 val2 bl1 bl2; if (col >= 100) col=TableFindCol(tab, col, false); val1 = (tab-->col)-->(row1+COL_HSIZE); val2 = (tab-->col)-->(row2+COL_HSIZE); if (val1 == TABLE_NOVALUE) bl1 = CheckTableEntryIsBlank(tab,col,row1); if (val2 == TABLE_NOVALUE) bl2 = CheckTableEntryIsBlank(tab,col,row2); if ((val1 == val2) && (bl1 == bl2)) { if (val1 ~= TABLE_NOVALUE) return 0; if (bl1 == false) return 0; ! The two entries are both blank: if (TableRowIsBlank(tab, row1)) { if (TableRowIsBlank(tab, row2)) return 0; return -1*dir; } if (TableRowIsBlank(tab, row2)) return dir; return 0; } if (bl1) return -1*dir; if (bl2) return dir; if (((tab-->col)-->1) & TB_COLUMN_SIGNED) { if (val1 > val2) return 1; return -1; } else { if (UnsignedCompare(val1, val2) > 0) return 1; return -1; } ]; [ TableMoveRowDown tab r1 r2 rx k l m v f; if (r1==r2) return; l = tab-->0; for (k=1:k<=l:k++) { f = false; m = (tab-->k)-->(r1+COL_HSIZE); if (m == TABLE_NOVALUE) f = true; for (rx=r1:rxk)-->(rx+COL_HSIZE+1); (tab-->k)-->(rx+COL_HSIZE) = v; if (v == TABLE_NOVALUE) f = true; } (tab-->k)-->(r2+COL_HSIZE) = m; if (f) TableMoveBlankBitsDown(tab, r1, r2, k); } ]; [ TableShuffle tab i j k; k = TableRows(tab); for (i=2:i<=k:i++) TableSwapRows(tab, i, random(i)); TableMoveBlanksToBack(tab, 1, k); ]; [ TableNextRow tab col row dir i k val v dv min_dv min_at signed_arithmetic f; if (col >= 100) col=TableFindCol(tab, col, false); signed_arithmetic = ((tab-->col)-->1) & TB_COLUMN_SIGNED; #Iftrue (WORDSIZE == 2); if (row == 0) { if (signed_arithmetic) { if (dir == 1) val = $8000; else val = $7fff; } else { if (dir == 1) val = 0; else val = $ffff; } } else val = (tab-->col)-->(row+COL_HSIZE); if (signed_arithmetic) min_dv = $7fff; else min_dv = $ffff; #ifnot; ! WORDSIZE == 4 if (row == 0) { if (signed_arithmetic) { if (dir == 1) val = $80000000; else val = $7fffffff; } else { if (dir == 1) val = 0; else val = $ffffffff; } } else val = (tab-->col)-->(row+COL_HSIZE); if (signed_arithmetic) min_dv = $7fffffff; else min_dv = $ffffffff; #endif; k = TableRows(tab); if (dir == 1) { for (i=1:i<=k:i++) { v = (tab-->col)-->(i+COL_HSIZE); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,i))) continue; dv = dir*v; if (signed_arithmetic) f = (((dv > dir*val) || ((v == val) && (i>row))) && (dv < min_dv)); else f = (((UnsignedCompare(dv, dir*val) > 0) || ((v == val) && (i>row))) && (UnsignedCompare(dv, min_dv) < 0)); if (f) { min_dv = dv; min_at = i; } } } else { for (i=k:i>=1:i--) { v = (tab-->col)-->(i+COL_HSIZE); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,i))) continue; dv = dir*v; if (signed_arithmetic) f = (((dv > dir*val) || ((v == val) && (i 0) || ((v == val) && (i0) && (lnbl>0) && (fbl < lnbl)) { TableMoveRowDown(tab, fbl, lnbl); ! Move first blank just past last nonblank TableMoveBlanksToBack(tab, fbl, lnbl-1); } return torow-blc; ! Final non-blank row ]; [ TableSort tab col dir test_flag algorithm i j k f; for (i=1:i<=tab-->0:i++) { j = tab-->i; ! Address of column table if ((j-->1) & TB_COLUMN_DONTSORTME) return RunTimeProblem(RTP_TABLE_CANTSORT, tab); } if (col >= 100) col=TableFindCol(tab, col, false); k = TableRows(tab); k = TableMoveBlanksToBack(tab, 1, k); if (test_flag) { print "After moving blanks to back:^"; TableColumnDebug(tab, col); } SetSortDomain(TableSwapRows, TableCompareRows); SortArray(tab, col, dir, k, test_flag, algorithm); if (test_flag) { print "Final state:^"; TableColumnDebug(tab, col); } ]; [ PrintTableName T; switch(T) { TheEmptyTable: print "(the empty table)"; return; T0_final_question_options: print "Table of Final Question Options"; return; T1_locale_priorities: print "Table of Locale Priorities"; return; T2_current_choices: print "Table of Current Choices"; return; T3_ordinary_status: print "Table of Ordinary Status"; return; T4_combat_order: print "Table of Combat Order"; return; T5_stored_combat_actions: print "Table of Stored Combat Actions"; return; T6_ai_combat_person_options: print "Table of AI Combat Person Options"; return; T7_ai_combat_options: print "Table of AI Combat Options"; return; T8_ai_combat_weapon_options: print "Table of AI Combat Weapon Options"; return; default: print "** No such table **"; } ]; [ TablePrint tab i j k row col v tc kov; for (i=1:i<=tab-->0:i++) { j = tab-->i; ! Address of column table if (((j-->1) & TB_COLUMN_CANEXCHANGE) == 0) rtrue; } k = TableRows(tab); k = TableMoveBlanksToBack(tab, 1, k); print "! ", (PrintTableName) tab, " (", k, ")^"; for (row=1:row<=k:row++) { for (col=1:col<=tab-->0:col++) { tc = ((tab-->col)-->1) & TB_COLUMN_NUMBER; kov = NUMBER_TY; for (i=0: TC_KOVs-->i: i=i+3) if (TC_KOVs-->i == tc) kov = TC_KOVs-->(i+1); v = (tab-->col)-->(row+COL_HSIZE); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,row))) print "-- "; else { if (BlkValueWriteToFile(v, kov) == false) print v; print " "; } } print "^"; } rfalse; ]; #ifdef TARGET_GLULX; [ TableRead tab auxf row maxrow col ch v sgn dg j tc kov; for (col=1:col<=tab-->0:col++) { j = tab-->col; ! Address of column table if (((j-->1) & TB_COLUMN_CANEXCHANGE) == 0) return RunTimeProblem(RTP_TABLE_CANTSAVE, tab); } maxrow = TableRows(tab); !print maxrow, " rows available.^"; for (row=1: row<=maxrow: row++) { TableBlankOutRow(tab, row); } for (row=1: row<=maxrow: row++) { !print "Reading row ", row, "^"; ch = FileIO_GetC(auxf); if (ch == '!') { while (ch ~= -1 or 10 or 13) ch = FileIO_GetC(auxf); while (ch == 10 or 13) ch = FileIO_GetC(auxf); } for (col=1: col<=tab-->0: col++) { if (ch == -1) { row++; jump NoMore; } if (ch == 10 or 13) break; tc = ((tab-->col)-->1) & TB_COLUMN_NUMBER; kov = NUMBER_TY; for (j=0: TC_KOVs-->j: j=j+3) if (TC_KOVs-->j == tc) kov = TC_KOVs-->(j+1); !print "tc = ", tc, " kov = ", kov, "^"; sgn = 1; if (ch == '-') { ch = FileIO_GetC(auxf); if (ch == -1) jump NotTable; if (ch == '-') { ch = FileIO_GetC(auxf); jump EntryDone; } sgn = -1; } if (((tab-->col)-->1) & TB_COLUMN_ALLOCATED) ForceTableEntryNonBlank(tab, col, row); !print "A"; v = BlkValueReadFromFile(0, 0, -1, kov); if (v) { if (((tab-->col)-->1) & TB_COLUMN_ALLOCATED) v = BlkValueReadFromFile(TableLookUpEntry(tab, col, row), auxf, ch, kov); else v = BlkValueReadFromFile(0, auxf, ch, kov); ch = 32; } else { dg = ch - '0'; if ((dg < 0) || (dg > 9)) jump NotTable; v = dg; for (::) { ch = FileIO_GetC(auxf); dg = ch - '0'; if ((dg < 0) || (dg > 9)) break; v = 10*v + dg; } v = v*sgn; } !print "v=", v, " "; if (((tab-->col)-->1) & TB_COLUMN_ALLOCATED == 0) TableLookUpEntry(tab, col, row, true, v); .EntryDone; !print "First nd is ", ch, "^"; while (ch == 9 or 32) ch = FileIO_GetC(auxf); } while (ch ~= -1 or 10 or 13) { if ((ch ~= '-') && (((ch-'0')<0) || ((ch-'0')>9))) jump NotTable; if (ch ~= 9 or 32) jump WontFit; ch = FileIO_GetC(auxf); } } .NoMore; while (ch == 9 or 32 or 10 or 13) ch = FileIO_GetC(auxf); if (ch == -1) return; .WontFit; return RunTimeProblem(RTP_TABLE_WONTFIT, tab); .NotTable; return RunTimeProblem(RTP_TABLE_BADFILE, tab); ]; #ENDIF; ! TARGET_GLULX [ PrintRank i j v; #ifdef RANKING_TABLE; L__M(##Score, 3); j = TableRows(RANKING_TABLE); for (i=j:i>=1:i--) if (score >= TableLookUpEntry(RANKING_TABLE, 1, i)) { v = TableLookUpEntry(RANKING_TABLE, 2, i); if (v ofclass String) print (string) v; else v(); "."; } #endif; "."; ]; [ TableColumnDebug tab col k i v; if (col >= 100) col=TableFindCol(tab, col, false); k = TableRows(tab); print "Table col ", col, ": "; for (i=1:i<=k:i++) { v = (tab-->col)-->(i+COL_HSIZE); if ((v == TABLE_NOVALUE) && (CheckTableEntryIsBlank(tab,col,i))) print "BLANK "; else print v, " "; } print "*^"; ]; [ HolderOf o; if (o && (o.component_parent)) return o.component_parent; if (o && (parent(o))) return parent(o); return nothing; ]; [ ParentOf o; if (o) o = parent(o); return o; ]; [ CoreOf o; while (o && (o provides component_parent) && (o.component_parent)) o = o.component_parent; return o; ]; [ CoreOfParentOfCoreOf o; while (o && (o provides component_parent) && (o.component_parent)) o = o.component_parent; if (o) o = parent(o); while (o && (o provides component_parent) && (o.component_parent)) o = o.component_parent; return o; ]; [ LocationOf o; if (~~(O ofclass K1_room or K2_thing)) return nothing; if (O ofclass K4_door) return FrontSideOfDoor(O); if (O ofclass K7_backdrop) return nothing; while (o) { if (o ofclass K1_room) return o; o = CoreOfParentOfCoreOf(o); } return nothing; ]; [ CommonAncestor o1 o2 i j; o1 = CoreOf(o1); o2 = CoreOf(o2); for (i=o1: i: i = CoreOfParentOfCoreOf(i)) for (j=o2: j: j = CoreOfParentOfCoreOf(j)) if (j == i) return j; return nothing; ]; [ IndirectlyContains o1 o2; if ((o1 == nothing) || (o2 == nothing)) rfalse; if ((o1 ofclass K1_room) && (o2 ofclass K4_door)) { if (o1 == FrontSideOfDoor(o2)) rtrue; if (o1 == BackSideOfDoor(o2)) rtrue; rfalse; } if (o2 ofclass K7_backdrop) rfalse; for (o2 = HolderOf(o2) : o2: o2 = HolderOf(o2)) if (o2 == o1) rtrue; rfalse; ]; [ WhetherIn obj; if (obj has enterable) { if (IndirectlyContains(obj, player)) rtrue; rfalse; } if (obj ofclass K9_region) return TestRegionalContainment(real_location, obj); if (obj ofclass K1_room) { if (obj == real_location) rtrue; rfalse; } RunTimeProblem(RTP_NOTINAROOM, obj); rfalse; ]; [ ContainerOf A p; if (A ofclass K1_room) return A.map_region; p = parent(A); if (p == nothing) return nothing; if (p ofclass K5_container) return p; if (p ofclass K1_room) return p; if (p ofclass K9_region) return p; return nothing; ]; [ TestContainmentRange obj e f; if (obj ofclass K9_region) { objectloop (f ofclass K1_room && f.map_region == obj) if (f > e) return f; return nothing; } if (obj ofclass K5_container or K1_room) { if (e == nothing) return child(obj); return sibling(e); } return nothing; ]; [ SupporterOf obj p; p = parent(obj); if (p == nothing) return nothing; if (p ofclass K6_supporter) return p; return nothing; ]; [ CarrierOf obj p; p = parent(obj); if (p && (p ofclass K8_person) && (obj hasnt worn)) return p; return nothing; ]; [ WearerOf obj p; p = parent(obj); if (p && (p ofclass K8_person) && (obj has worn)) return p; return nothing; ]; [ OwnerOf obj p; p = parent(obj); if (p && (p ofclass K8_person)) return p; return nothing; ]; [ MakePart P Of First; if (parent(P)) remove P; give P ~worn; if (Of == nothing) { DetachPart(P); return; } if (P.component_parent) DetachPart(P); P.component_parent = Of; First = Of.component_child; Of.component_child = P; P.component_sibling = First; ]; [ DetachPart P From Daddy O; Daddy = P.component_parent; P.component_parent = nothing; if (Daddy == nothing) { P.component_sibling = nothing; return; } if (Daddy.component_child == P) { Daddy.component_child = P.component_sibling; P.component_sibling = nothing; return; } for (O = Daddy.component_child: O: O = O.component_sibling) if (O.component_sibling == P) { O.component_sibling = P.component_sibling; P.component_sibling = nothing; return; } ]; [ MoveObject F T opt going_mode was; if (F == nothing) return RunTimeProblem(RTP_CANTMOVENOTHING); if (F ofclass K7_backdrop) { if (T ofclass K9_region) { give F ~absent; F.found_in = T.regional_found_in; if (TestRegionalContainment(LocationOf(player), T)) move F to LocationOf(player); else remove F; return; } return RunTimeProblem(RTP_BACKDROP, F, T); } if (~~(F ofclass K2_thing)) return RunTimeProblem(RTP_NOTTHING, F, T); if (T ofclass K9_region) return RunTimeProblem(RTP_NOTBACKDROP, F, T); if (F has worn) { give F ~worn; if (F in T) return; } DetachPart(F); if (going_mode == false) { if (F == player) { PlayerTo(T, opt); return; } if ((IndirectlyContains(F, player)) && (LocationOf(player) ~= LocationOf(T))) { was = parent(player); move player to real_location; move F to T; PlayerTo(was, true); return; } } move F to T; ]; [ RemoveFromPlay F; if (F == nothing) return RunTimeProblem(RTP_CANTREMOVENOTHING); if (F == player) return RunTimeProblem(RTP_CANTREMOVEPLAYER); if (F ofclass K4_door) return RunTimeProblem(RTP_CANTREMOVEDOORS); give F ~worn; DetachPart(F); if (F ofclass K7_backdrop) give F absent; remove F; ]; [ OnStage O x; if (O ofclass K1_room) rfalse; while (metaclass(O) == Object) { if (O ofclass K1_room) rtrue; if (O ofclass K9_region) rfalse; if (O ofclass K4_door) rtrue; if (O ofclass K7_backdrop) { if (O has absent) rfalse; rtrue; } x = O.component_parent; if (x) { O = x; continue; } x = parent(O); if (x) { O = x; continue; } rfalse; } rfalse; ]; [ PlayerTo newplace flag; @push actor; actor = player; move player to newplace; location = LocationOf(newplace); real_location = location; MoveFloatingObjects(); ADJUST_LIGHT_R(1); DivideParagraphPoint(); if (flag == 0) ; if (flag == 1) give location visited; if (flag == 2) AbbreviatedRoomDescription(); @pull actor; ]; [ MoveDuringGoing F T; MoveObject(F, T, 0, true); if (actor == player) { location = LocationOf(player); real_location = location; } ]; [ FoundEverywhere; rtrue; ]; [ ChangePlayer obj flag i; if (~~(obj ofclass K8_person)) return RunTimeProblem(RTP_CANTCHANGE, obj); if (~~(OnStage(obj))) return RunTimeProblem(RTP_CANTCHANGEOFFSTAGE, obj); if (obj == player) return; give player ~concealed; if (player has remove_proper) give player ~proper; if (player == selfobj) { player.saved_short_name = player.short_name; player.short_name = FORMER__TX; } player = obj; if (player == selfobj) { player.short_name = player.saved_short_name; } if (player hasnt proper) give player remove_proper; ! when changing out again give player concealed proper; location = LocationOf(player); real_location = location; MoveFloatingObjects(); SilentlyConsiderLight(); ]; [ MoveFloatingObjects i k l m address flag; if (real_location == nothing) return; objectloop (i) { address = i.&found_in; if (address ~= 0 && i hasnt absent) { if (ZRegion(address-->0) == 2) { m = address-->0; .TestPropositionally; if (m.call(real_location) ~= 0) move i to real_location; else remove i; } else { k = i.#found_in; for (l=0 : ll; if (ZRegion(m) == 2) jump TestPropositionally; if (m == real_location || m in real_location) { if (i notin real_location) move i to real_location; flag = true; } } if (flag == false) { if (parent(i)) remove i; } } } } ]; [ MoveBackdrop bd D x address; if (~~(bd ofclass K7_backdrop)) return RunTimeProblem(RTP_BACKDROPONLY, bd); if (bd.#found_in > WORDSIZE) { address = bd.&found_in; address-->0 = D; } else bd.found_in = D; give bd ~absent; MoveFloatingObjects(); ]; [ WearObject X P opt; if (X == false) rfalse; if (X notin P) MoveObject(X, P, opt); give X worn; ]; [ MapConnection from_room dir in_direction through_door; if ((from_room ofclass K1_room) && (dir ofclass K3_direction)) { in_direction = Map_Storage--> ((from_room.IK_1)*No_Directions + dir.IK_3); if (in_direction ofclass K1_room) return in_direction; if (in_direction ofclass K4_door) { @push location; location = from_room; through_door = in_direction.door_to(); @pull location; if (through_door ofclass K1_room) return through_door; } } return nothing; ]; [ DoorFrom obj dir rv; rv = RoomOrDoorFrom(obj, dir); if (rv ofclass K4_door) return rv; return nothing; ]; [ RoomOrDoorFrom obj dir use_doors in_direction sl through_door; if ((obj ofclass K1_room) && (dir ofclass K3_direction)) { in_direction = Map_Storage--> ((obj.IK_1)*No_Directions + dir.IK_3); if (in_direction ofclass K1_room or K4_door) return in_direction; } return nothing; ]; [ AssertMapConnection r1 dir r2 in_direction; SignalMapChange(); in_direction = Map_Storage--> ((r1.IK_1)*No_Directions + dir.IK_3); if ((in_direction == 0) || (in_direction ofclass K1_room)) { Map_Storage-->((r1.IK_1)*No_Directions + dir.IK_3) = r2; return; } if (in_direction ofclass K4_door) { RunTimeProblem(RTP_EXITDOOR, r1, dir); return; } RunTimeProblem(RTP_NOEXIT, r1, dir); ]; [ AssertMapUnconnection r1 dir r2 in_direction; SignalMapChange(); in_direction = Map_Storage--> ((r1.IK_1)*No_Directions + dir.IK_3); if (r1 ofclass K4_door) { RunTimeProblem(RTP_EXITDOOR, r1, dir); return; } if (in_direction == r2) Map_Storage-->((r1.IK_1)*No_Directions + dir.IK_3) = 0; return; ]; [ TestAdjacency R1 R2 i row; row = (R1.IK_1)*No_Directions; for (i=0: irow == R2) rtrue; rfalse; ]; [ TestRegionalContainment obj region o; if ((obj == nothing) || (region == nothing)) rfalse; if (~~(obj ofclass K1_room)) obj = LocationOf(obj); if (obj == nothing) rfalse; o = obj.map_region; while (o) { if (o == region) rtrue; o = parent(o); } rfalse; ]; [ FrontSideOfDoor D; if (~~(D ofclass K4_door)) rfalse; if (D provides found_in) return (D.&found_in)-->0; ! Two-sided return parent(D); ! One-sided ]; [ BackSideOfDoor D; if (~~(D ofclass K4_door)) rfalse; if (D provides found_in) return (D.&found_in)-->1; ! Two-sided return nothing; ! One-sided ]; [ OtherSideOfDoor D from_room rv; if (D ofclass K4_door) { @push location; location = LocationOf(from_room); rv = D.door_to(); @pull location; } return rv; ]; [ DirectionDoorLeadsIn D from_room rv dir; if (D ofclass K4_door) { @push location; location = LocationOf(from_room); rv = D.door_dir(); @pull location; } return rv; ]; [ TestVisibility A B; if (~~OffersLight(parent(CoreOf(A)))) rfalse; if (suppress_scope_loops) rtrue; return TestScope(B, A); ]; [ TestTouchability A B; if (TestScope(B,A) == false) rfalse; if (ObjectIsUntouchable(B, 1, 0, A)) rfalse; rtrue; ]; [ TestConcealment A B; if (A ofclass K2_thing && B ofclass K2_thing) { particular_possession = B; if (CarryOutActivity(DECIDING_CONCEALED_POSSESS_ACT, A)) rtrue; } rfalse; ]; [ DECIMAL_TOKEN wnc wna r n wa wl sign base digit digit_count original_wn group_wn; wnc = wn; original_wn = wn; group_wn = wn; wn = wnc; r = ParseTokenStopped(ELEMENTARY_TT, NUMBER_TOKEN); if ((r == GPR_NUMBER) && (parsed_number ~= 10000)) return r; wn = wnc; wa = WordAddress(wn); wl = WordLength(wn); sign = 1; base = 10; digit_count = 0; if (wa->0 ~= '-' or '$' or '0' or '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9') return GPR_FAIL; if (wa->0 == '-') { sign = -1; wl--; wa++; } if (wl == 0) return GPR_FAIL; n = 0; while (wl > 0) { if (wa->0 >= 'a') digit = wa->0 - 'a' + 10; else digit = wa->0 - '0'; digit_count++; switch (base) { 2: if (digit_count == 17) return GPR_FAIL; 10: #Iftrue (WORDSIZE == 2); if (digit_count == 6) return GPR_FAIL; if (digit_count == 5) { if (n > 3276) return GPR_FAIL; if (n == 3276) { if (sign == 1 && digit > 7) return GPR_FAIL; if (sign == -1 && digit > 8) return GPR_FAIL; } } #Ifnot; ! i.e., if (WORDSIZE == 4) if (digit_count == 11) return GPR_FAIL; if (digit_count == 10) { if (n > 214748364) return GPR_FAIL; if (n == 214748364) { if (sign == 1 && digit > 7) return GPR_FAIL; if (sign == -1 && digit > 8) return GPR_FAIL; } } #Endif; 16: if (digit_count == 5) return GPR_FAIL; } if (digit >= 0 && digit < base) n = base*n + digit; else return GPR_FAIL; wl--; wa++; } parsed_number = n*sign; wn++; return GPR_NUMBER; ]; [ TRUTH_STATE_TOKEN original_wn wd; original_wn = wn; wn = original_wn; wd = NextWordStopped(); if (wd == 'true') { parsed_number = 1; return GPR_NUMBER; } if (wd == 'false') { parsed_number = 0; return GPR_NUMBER; } wn = original_wn; return GPR_FAIL; ]; [ RoundOffTime t1 t2; return ((t1+t2/2)/t2)*t2; ]; [ SquareRoot num op res one; op = num; if (num < 0) { RunTimeProblem(RTP_NEGATIVEROOT); return 1; } ! "one" starts at the highest power of four <= the argument. for (one = WORD_NEXTTOHIGHBIT: one > op: one = one/4) ; while (one ~= 0) { !print "Round: op = ", op, " res = ", res, ", res**2 = ", res*res, " one = ", one, "^"; if (op >= res + one) { op = op - res - one; res = res + one*2; } res = res/2; one = one/4; } !print "Res is ", res, "^"; return res; ]; [ CubeRoot num x y n; if (num < 0) x = -SquareRoot(-num); else x = SquareRoot(num); for (n=0: (y ~= x) && (n++ < 100): y = x, x = (2*x + num/x/x)/3) ; return x; ]; [ PrintTimeOfDay t h aop; if (t<0) { print ""; return; } if (t >= TWELVE_HOURS) { aop = "pm"; t = t - TWELVE_HOURS; } else aop = "am"; h = t/ONE_HOUR; if (h==0) h=12; print h, ":"; if (t%ONE_HOUR < 10) print "0"; print t%ONE_HOUR, " ", (string) aop; ]; [ PrintTimeOfDayEnglish t h m dir aop; h = (t/ONE_HOUR) % 12; m = t%ONE_HOUR; if (h==0) h=12; if (m==0) { print (number) h, " o'clock"; return; } dir = "past"; if (m > HALF_HOUR) { m = ONE_HOUR-m; h = (h+1)%12; if (h==0) h=12; dir = "to"; } switch(m) { QUARTER_HOUR: print "quarter"; HALF_HOUR: print "half"; default: print (number) m; if (m%5 ~= 0) { if (m == 1) print " minute"; else print " minutes"; } } print " ", (string) dir, " ", (number) h; ]; [ TIME_TOKEN first_word second_word at length flag illegal_char offhour hr mn i original_wn; original_wn = wn; wn = original_wn; first_word = NextWordStopped(); switch (first_word) { 'midnight': parsed_number = 0; return GPR_NUMBER; 'midday', 'noon': parsed_number = TWELVE_HOURS; return GPR_NUMBER; } ! Next try the format 12:02 at = WordAddress(wn-1); length = WordLength(wn-1); for (i=0: ii) { ':': if (flag == false && i>0 && i 5 || illegal_char) flag = false; if (flag) { for (i=0: at->i~=':': i++, hr=hr*10) hr = hr + at->i - '0'; hr = hr/10; for (i++: ii - '0'; mn = mn/10; second_word = NextWordStopped(); parsed_number = HoursMinsWordToTime(hr, mn, second_word); if (parsed_number == -1) return GPR_FAIL; if (second_word ~= 'pm' or 'am') wn--; return GPR_NUMBER; } ! Lastly the wordy format offhour = -1; if (first_word == 'half') offhour = HALF_HOUR; if (first_word == 'quarter') offhour = QUARTER_HOUR; if (offhour < 0) offhour = TryNumber(wn-1); if (offhour < 0 || offhour >= ONE_HOUR) return GPR_FAIL; second_word = NextWordStopped(); switch (second_word) { ! "six o'clock", "six" 'o^clock', 'am', 'pm', -1: hr = offhour; if (hr > 12) return GPR_FAIL; ! "quarter to six", "twenty past midnight" 'to', 'past': mn = offhour; hr = TryNumber(wn); if (hr <= 0) { switch (NextWordStopped()) { 'noon', 'midday': hr = 12; 'midnight': hr = 0; default: return GPR_FAIL; } } if (hr >= 13) return GPR_FAIL; if (second_word == 'to') { mn = ONE_HOUR-mn; hr--; if (hr<0) hr=23; } wn++; second_word = NextWordStopped(); ! "six thirty" default: hr = offhour; mn = TryNumber(--wn); if (mn < 0 || mn >= ONE_HOUR) return GPR_FAIL; wn++; second_word = NextWordStopped(); } parsed_number = HoursMinsWordToTime(hr, mn, second_word); if (parsed_number < 0) return GPR_FAIL; if (second_word ~= 'pm' or 'am' or 'o^clock') wn--; return GPR_NUMBER; ]; [ HoursMinsWordToTime hour minute word x; if (hour >= 24) return -1; if (minute >= ONE_HOUR) return -1; x = hour*ONE_HOUR + minute; if (hour >= 13) return x; x = x % TWELVE_HOURS; if (word == 'pm') x = x + TWELVE_HOURS; if (word ~= 'am' or 'pm' && hour == 12) x = x + TWELVE_HOURS; return x; ]; [ RELATIVE_TIME_TOKEN first_word second_word offhour mult mn original_wn; original_wn = wn; wn = original_wn; first_word = NextWordStopped(); wn--; if (first_word == 'an' or 'a//') mn=1; else mn=TryNumber(wn); if (mn == -1000) { first_word = NextWordStopped(); if (first_word == 'half') offhour = HALF_HOUR; if (first_word == 'quarter') offhour = QUARTER_HOUR; if (offhour > 0) { second_word = NextWordStopped(); if (second_word == 'of') second_word = NextWordStopped(); if (second_word == 'an') second_word = NextWordStopped(); if (second_word == 'hour') { parsed_number = offhour; return GPR_NUMBER; } } return GPR_FAIL; } wn++; first_word = NextWordStopped(); switch (first_word) { 'minutes', 'minute': mult = 1; 'hours', 'hour': mult = 60; default: return GPR_FAIL; } parsed_number = mn*mult; if (mult == 60) { mn=TryNumber(wn); if (mn ~= -1000) { wn++; first_word = NextWordStopped(); if (first_word == 'minutes' or 'minute') parsed_number = parsed_number + mn; else wn = wn - 2; } } return GPR_NUMBER; ]; [ DuringSceneMatching prop sc; for (sc=0: scsc == 1) && (prop(sc+1))) rtrue; rfalse; ]; [ SceneUtility sc task; if (sc <= 0) return 0; if (task == 1 or 2) { if (scene_endings-->(sc-1) == 0) return RunTimeProblem(RTP_SCENEHASNTSTARTED, sc); } else { if (scene_endings-->(sc-1) <= 1) return RunTimeProblem(RTP_SCENEHASNTENDED, sc); } switch (task) { 1: return (the_time - scene_started-->(sc-1))%(TWENTY_FOUR_HOURS); 2: return scene_started-->(sc-1); 3: return (the_time - scene_ended-->(sc-1))%(TWENTY_FOUR_HOURS); 4: return scene_ended-->(sc-1); } ]; [ Noun_Filter_0 x; x=noun; return ((noun ofclass K3_direction)); ]; [ Noun_Filter_1 x; x=noun; return ((noun ofclass K3_direction)); ]; [ Noun_Filter_2 x; x=noun; return ((noun ofclass K3_direction)); ]; [ Noun_Filter_3 x; x=noun; return ((noun ofclass K2_thing)); ]; [ Noun_Filter_4 x; x=noun; return ((noun ofclass K31_weapon)); ]; [ Noun_Filter_5 x; x=noun; return ((noun ofclass K31_weapon)); ]; #IFDEF DEBUG; Array TestText_0 -> "take sword/ready sword/south/2/2/east||||"; Array TestReq_0 --> 0 0; [ XAbstractSub; if (XTestMove(noun, second)) return; move noun to second; "[Abstracted.]"; ]; [ XTestMove obj dest; if ((obj <= InformLibrary) || (obj == LibraryMessages)) "[Can't move ", (name) obj, ": it's a system object.]"; if (obj.component_parent) "[Can't move ", (name) obj, ": it's part of ", (the) obj.component_parent, ".]"; while (dest) { if (dest == obj) "[Can't move ", (name) obj, ": it would contain itself.]"; dest = CoreOfParentOfCoreOf(dest); } rfalse; ]; [ ActionsOnSub; trace_actions = 1; say__p = 1; "Actions listing on."; ]; [ ActionsOffSub; trace_actions = 0; say__p = 1; "Actions listing off."; ]; [ GonearSub; PlayerTo(LocationOf(noun)); ]; [ XPurloinSub; if (XTestMove(noun, player)) return; move noun to player; give noun moved ~concealed; say__p = 1; "[Purloined.]"; ]; [ PredictableSub; VM_Seed_RNG(-100); say__p = 1; "[Random number generator now predictable.]"; ]; [ ShowRelationsSub rc tot; for (rc=0:rc<239:rc++) tot = tot + Relation_ShowR(rc); say__p = 1; if (tot == 0) "No new relations have been created."; ]; [ RulesOnSub; debug_rules = 1; say__p = 1; "Rules tracing now switched on. Type ~rules off~ to switch it off again, or ~rules all~ to include even rules which do not apply."; ]; [ RulesAllSub; debug_rules = 2; say__p = 1; "Rules tracing now switched to ~all~. Type ~rules off~ to switch it off again."; ]; [ RulesOffSub; debug_rules = 0; say__p = 1; "Rules tracing now switched off. Type ~rules~ to switch it on again."; ]; [ ScenesOnSub; debug_scenes = 1; ShowSceneStatus(); say__p = 1; "(Scene monitoring now switched on. Type ~scenes off~ to switch it off again.)"; ]; [ ScenesOffSub; debug_scenes = 0; say__p = 1; "(Scene monitoring now switched off. Type ~scenes~ to switch it on again.)"; ]; Global x_scope_count; [ ScopeSub; x_scope_count = 0; LoopOverScope(Print_ScL, noun); if (x_scope_count == 0) "Nothing is in scope."; ]; [ Print_ScL obj; print_ret ++x_scope_count, ": ", (a) obj, " (", obj, ")"; ]; [ ShowHeapSub; DebugHeap(); ]; [ ShowMeSub view na; view = noun; if (noun == nothing) noun = real_location; if (ShowMeRecursively(noun, 0, (noun == real_location))) { if (noun == real_location) print "* denotes things which are not in scope^"; } if (view ofclass K2_thing) { print "location:"; ShowRLocation(noun, true); print "^"; } if (view ofclass K1_room) { na = 0; if (view has light) { if (na++ > 0) print "; "; print "lighted"; } if (view hasnt light) { if (na++ > 0) print "; "; print "dark"; } if (view has visited) { if (na++ > 0) print "; "; print "visited"; } if (view hasnt visited) { if (na++ > 0) print "; "; print "unvisited"; } if (na>0) print "^"; if (view provides description) print "description: ", (PrintText) ValueProperty(view, description), "^"; if (view provides short_name) print "printed name: ", (PrintText) ValueProperty(view, short_name), "^"; if (view provides map_region) print "map region: ", (PrintShortName) ValueProperty(view, map_region), "^"; } if (view ofclass K2_thing) { na = 0; if (view has light) { if (na++ > 0) print "; "; print "lit"; } if (view hasnt light) { if (na++ > 0) print "; "; print "unlit"; } if (view has edible) { if (na++ > 0) print "; "; print "edible"; } if (view hasnt edible) { if (na++ > 0) print "; "; print "inedible"; } if (view has static) { if (na++ > 0) print "; "; print "fixed in place"; } if (view hasnt static) { if (na++ > 0) print "; "; print "portable"; } if (view has scenery) { if (na++ > 0) print "; "; print "scenery"; } if (view has clothing) { if (na++ > 0) print "; "; print "wearable"; } if (view has pushable) { if (na++ > 0) print "; "; print "pushable between rooms"; } if (view has moved) { if (na++ > 0) print "; "; print "handled"; } if (view has pluralname) { if (na++ > 0) print "; "; print "plural-named"; } if (view hasnt pluralname) { if (na++ > 0) print "; "; print "singular-named"; } if (view has proper) { if (na++ > 0) print "; "; print "proper-named"; } if (view hasnt proper) { if (na++ > 0) print "; "; print "improper-named"; } if (view has neuter) { if (na++ > 0) print "; "; print "neuter"; } if (view has p72_ambiguously_plural) { if (na++ > 0) print "; "; print "ambiguously plural"; } if (view hasnt p72_ambiguously_plural) { if (na++ > 0) print "; "; print "ordinarily enumerated"; } if (na>0) print "^"; if (view provides description) print "description: ", (PrintText) ValueProperty(view, description), "^"; if (view provides short_name) print "printed name: ", (PrintText) ValueProperty(view, short_name), "^"; if (view provides article) print "indefinite article: ", (PrintText) ValueProperty(view, article), "^"; if (view provides initial) print "initial appearance: ", (PrintText) ValueProperty(view, initial), "^"; if (view provides plural) print "printed plural name: ", (PrintText) ValueProperty(view, plural), "^"; if (view provides with_key) print "matching key: ", (PrintShortName) ValueProperty(view, with_key), "^"; } if (view ofclass K3_direction) { na = 0; if (na>0) print "^"; if (view provides p6_opposite) print "opposite: ", (PrintShortName) ValueProperty(view, p6_opposite), "^"; } if (view ofclass K4_door) { na = 0; if (view has open) { if (na++ > 0) print "; "; print "open"; } if (view hasnt open) { if (na++ > 0) print "; "; print "closed"; } if (view has openable) { if (na++ > 0) print "; "; print "openable"; } if (view hasnt openable) { if (na++ > 0) print "; "; print "unopenable"; } if (view has lockable) { if (na++ > 0) print "; "; print "lockable"; } if (view has locked) { if (na++ > 0) print "; "; print "locked"; } if (view hasnt locked) { if (na++ > 0) print "; "; print "unlocked"; } if (na>0) print "^"; if (view provides door_to) print "other side: ", (PrintShortName) ValueProperty(view, door_to), "^"; } if (view ofclass K5_container) { na = 0; if (view has enterable) { if (na++ > 0) print "; "; print "enterable"; } if (view hasnt transparent) { if (na++ > 0) print "; "; print "opaque"; } if (view has transparent) { if (na++ > 0) print "; "; print "transparent"; } if (view has open) { if (na++ > 0) print "; "; print "open"; } if (view hasnt open) { if (na++ > 0) print "; "; print "closed"; } if (view has openable) { if (na++ > 0) print "; "; print "openable"; } if (view hasnt openable) { if (na++ > 0) print "; "; print "unopenable"; } if (view has lockable) { if (na++ > 0) print "; "; print "lockable"; } if (view has locked) { if (na++ > 0) print "; "; print "locked"; } if (view hasnt locked) { if (na++ > 0) print "; "; print "unlocked"; } if (na>0) print "^"; if (view provides capacity) print "carrying capacity: ", (DecimalNumber) ValueProperty(view, capacity), "^"; } if (view ofclass K6_supporter) { na = 0; if (view has enterable) { if (na++ > 0) print "; "; print "enterable"; } if (na>0) print "^"; if (view provides capacity) print "carrying capacity: ", (DecimalNumber) ValueProperty(view, capacity), "^"; } if (view ofclass K8_person) { na = 0; if (view has female) { if (na++ > 0) print "; "; print "female"; } if (view hasnt female) { if (na++ > 0) print "; "; print "male"; } if (view has p80_at_parry) { if (na++ > 0) print "; "; print "at parry"; } if (view hasnt p80_at_parry) { if (na++ > 0) print "; "; print "not at parry"; } if (view has p82_at_dodge) { if (na++ > 0) print "; "; print "at dodge"; } if (view hasnt p82_at_dodge) { if (na++ > 0) print "; "; print "not at dodge"; } if (na>0) print "^"; if (view provides capacity) print "carrying capacity: ", (DecimalNumber) ValueProperty(view, capacity), "^"; if (view provides p10_health) print "health: ", (DecimalNumber) ValueProperty(view, p10_health), "^"; if (view provides p11_permanent_health) print "permanent health: ", (DecimalNumber) ValueProperty(view, p11_permanent_health), "^"; if (view provides p12_gained_health) print "gained health: ", (DecimalNumber) ValueProperty(view, p12_gained_health), "^"; if (view provides p13_melee) print "melee: ", (DecimalNumber) ValueProperty(view, p13_melee), "^"; if (view provides p14_defence) print "defence: ", (DecimalNumber) ValueProperty(view, p14_defence), "^"; if (view provides p15_damage_die) print "damage die: ", (DecimalNumber) ValueProperty(view, p15_damage_die), "^"; if (view provides p16_initiative_modifier) print "initiative modifier: ", (DecimalNumber) ValueProperty(view, p16_initiative_modifier), "^"; if (view provides p17_concentration) print "concentration: ", (DecimalNumber) ValueProperty(view, p17_concentration), "^"; if (view provides p18_combat_ai_rulebook) print "combat AI rulebook: ", (RulePrintingRule) ValueProperty(view, p18_combat_ai_rulebook), "^"; if (view provides p74_hostility) print "hostility: ", (T49_hostility) ValueProperty(view, p74_hostility), "^"; if (view provides p76_combat_state) print "combat state: ", (T50_combat_state) ValueProperty(view, p76_combat_state), "^"; if (view provides p77_react_state) print "react state: ", (T51_react_state) ValueProperty(view, p77_react_state), "^"; } if (view ofclass K26_device) { na = 0; if (view has on) { if (na++ > 0) print "; "; print "switched on"; } if (view hasnt on) { if (na++ > 0) print "; "; print "switched off"; } if (na>0) print "^"; } if (view ofclass K31_weapon) { na = 0; if (view has p78_readied) { if (na++ > 0) print "; "; print "readied"; } if (view hasnt p78_readied) { if (na++ > 0) print "; "; print "not readied"; } if (na>0) print "^"; if (view provides p15_damage_die) print "damage die: ", (DecimalNumber) ValueProperty(view, p15_damage_die), "^"; if (view provides p19_dodgability) print "dodgability: ", (DecimalNumber) ValueProperty(view, p19_dodgability), "^"; if (view provides p20_passive_parry_max) print "passive parry max: ", (DecimalNumber) ValueProperty(view, p20_passive_parry_max), "^"; if (view provides p21_active_parry_max) print "active parry max: ", (DecimalNumber) ValueProperty(view, p21_active_parry_max), "^"; if (view provides p22_weapon_attack_bonus) print "weapon attack bonus: ", (DecimalNumber) ValueProperty(view, p22_weapon_attack_bonus), "^"; if (view provides p23_maximum_shots) print "maximum shots: ", (DecimalNumber) ValueProperty(view, p23_maximum_shots), "^"; if (view provides p24_current_shots) print "current shots: ", (DecimalNumber) ValueProperty(view, p24_current_shots), "^"; if (view provides p25_maximum_load_time) print "maximum load time: ", (DecimalNumber) ValueProperty(view, p25_maximum_load_time), "^"; if (view provides p26_current_load_time) print "current load time: ", (DecimalNumber) ValueProperty(view, p26_current_load_time), "^"; } ]; [ ShowRLocation obj top; if (obj ofclass K1_room) return; print " "; if (parent(obj)) { if (obj has worn) print "worn by "; else { if (parent(obj) has animate) print "carried by "; if (parent(obj) has container) print "in "; if (parent(obj) ofclass K1_room) print "in "; if (parent(obj) has supporter) print "on "; } print (the) parent(obj); ShowRLocation(parent(obj)); } else { if (obj.component_parent) { if (top == false) print ", which is "; print "part of ", (the) obj.component_parent; ShowRLocation(obj.component_parent); } else print "out of play"; } ]; [ ShowMeRecursively obj depth f c i k; spaces(2*depth); if (f && (depth > 0) && (TestScope(obj, player) == false)) { print "*"; c = true; } print (name) obj; if (depth > 0) { if (obj.component_parent) print " (part of ", (name) obj.component_parent, ")"; if (obj has worn) print " (worn)"; } if (obj provides IK_0) { k = KindHierarchy-->((obj.IK_0)*2); if ((k ~= K2_thing) || (depth==0)) { print " - "; if (k == K4_door or K5_container) { if (obj has transparent) print "transparent "; if (obj has locked) print "locked "; else if (obj has open) print "open "; else print "closed "; } print (I7_Kind_Name) k; } } print "^"; if (obj.component_child) c = c | ShowMeRecursively(obj.component_child, depth+2, f); if ((depth>0) && (obj.component_sibling)) c = c | ShowMeRecursively(obj.component_sibling, depth, f); if (child(obj)) c = c | ShowMeRecursively(child(obj), depth+2, f); if ((depth>0) && (sibling(obj))) c = c | ShowMeRecursively(sibling(obj), depth, f); return c; ]; [ ShowVerbSub address lines meta i; if (noun == 0 || ((noun->#dict_par1) & 1) == 0) "Try typing ~showverb~ and then the name of a verb."; meta = ((noun->#dict_par1) & 2)/2; i = DictionaryWordToVerbNum(noun); address = VM_CommandTableAddress(i); lines = address->0; address++; print "Verb "; if (meta) print "meta "; VM_PrintCommandWords(i); new_line; if (lines == 0) "has no grammar lines."; for (: lines>0 : lines--) { address = UnpackGrammarLine(address); print " "; DebugGrammarLine(); new_line; } ]; [ DebugGrammarLine pcount; print " * "; for (: line_token-->pcount ~= ENDIT_TOKEN : pcount++) { if ((line_token-->pcount)->0 & $10) print "/ "; print (DebugToken) line_token-->pcount, " "; } print "-> ", (DebugAction) action_to_be; if (action_reversed) print " reverse"; ]; [ DebugToken token; AnalyseToken(token); switch (found_ttype) { ILLEGAL_TT: print ""; ELEMENTARY_TT: switch (found_tdata) { NOUN_TOKEN: print "noun"; HELD_TOKEN: print "held"; MULTI_TOKEN: print "multi"; MULTIHELD_TOKEN: print "multiheld"; MULTIEXCEPT_TOKEN: print "multiexcept"; MULTIINSIDE_TOKEN: print "multiinside"; CREATURE_TOKEN: print "creature"; SPECIAL_TOKEN: print "special"; NUMBER_TOKEN: print "number"; TOPIC_TOKEN: print "topic"; ENDIT_TOKEN: print "END"; } PREPOSITION_TT: print "'", (address) found_tdata, "'"; ROUTINE_FILTER_TT: print "noun=Routine(", found_tdata, ")"; ATTR_FILTER_TT: print (DebugAttribute) found_tdata; SCOPE_TT: print "scope=Routine(", found_tdata, ")"; GPR_TT: print "Routine(", found_tdata, ")"; } ]; #Iftrue (1 > 0); [ TestScriptSub; switch(special_word) { 'boar//': TestStart(TestText_0, TestReq_0, 37); default: print ">--> The following tests are available:^"; print "'test boar'^"; } ]; Constant TEST_STACK_SIZE = 40; Array test_stack --> TEST_STACK_SIZE; Global test_sp = 0; [ TestStart T R l k; if (test_sp >= TEST_STACK_SIZE) ">--> Testing too many levels deep"; test_stack-->test_sp = T; test_stack-->(test_sp+1) = 0; test_stack-->(test_sp+3) = l; test_sp = test_sp + 4; if ((R-->0) && (R-->0 ~= real_location)) { print "(first moving to ", (name) R-->0, ")^"; PlayerTo(R-->0, 1); } k=1; while (R-->k) { if (R-->k notin player) { print "(first acquiring ", (the) R-->k, ")^"; move R-->k to player; } k++; } print "(Testing.)^"; say__p = 1; ]; [ TestKeyboardPrimitive a_buffer a_table p i j l spaced ch; if (test_sp == 0) { test_stack-->2 = 1; return VM_ReadKeyboard(a_buffer, a_table); } else { p = test_stack-->(test_sp-4); i = test_stack-->(test_sp-3); l = test_stack-->(test_sp-1); print "["; print test_stack-->2; print "] "; test_stack-->2 = test_stack-->2 + 1; style bold; while ((i < l) && (p->i ~= '/')) { ch = p->i; if (spaced || (ch ~= ' ')) { if ((p->i == '[') && (p->(i+1) == '/') && (p->(i+2) == ']')) { ch = '/'; i = i+2; } a_buffer->(j+WORDSIZE) = ch; print (char) ch; i++; j++; spaced = true; } else i++; } style roman; print "^"; #ifdef TARGET_ZCODE; a_buffer->1 = j; #ifnot; ! TARGET_GLULX a_buffer-->0 = j; #endif; VM_Tokenise(a_buffer, a_table); if (p->i == '/') i++; if (i >= l) { test_sp = test_sp - 4; } else test_stack-->(test_sp-3) = i; } ]; #IFNOT; [ TestScriptSub; ">--> No test scripts exist for this game."; ]; #ENDIF; [ TraceOnSub; parser_trace=1; say__p = 1; "[Trace on.]"; ]; [ TraceLevelSub; parser_trace = noun; say__p = 1; print "[Parser tracing set to level ", parser_trace, ".]^"; ]; [ TraceOffSub; parser_trace=0; say__p = 1; "Trace off."; ]; [ XTreeSub i; if (noun == 0) { objectloop (i) if (i ofclass Object && parent(i) == 0) XObj(i); } else XObj(noun,1); ]; [ XObj obj f; if (parent(obj) == 0) print (name) obj; else print (a) obj; print " (", obj, ") "; if (f == 1 && parent(obj) ~= 0) print "(in ", (name) parent(obj), " ", parent(obj), ")"; new_line; if (child(obj) == 0) rtrue; if (obj == Class) WriteListFrom(child(obj), NEWLINE_BIT+INDENT_BIT+ALWAYS_BIT+NOARTICLE_BIT, 1); else WriteListFrom(child(obj), NEWLINE_BIT+INDENT_BIT+ALWAYS_BIT+FULLINV_BIT, 1); ]; [ testcommandnoun obj o2; switch (scope_stage) { 1: rtrue; ! allow multiple objects 2: objectloop (obj) if ((obj ofclass Object) && (obj provides IK_0)) PlaceInScope(obj, true); 3: print "There seems to be no such object anywhere in the model world.^"; } ]; Verb meta 'abstract' * scope=testcommandnoun 'to' scope=testcommandnoun -> XAbstract; Verb meta 'actions' * -> ActionsOn * 'on' -> ActionsOn * 'off' -> ActionsOff; Verb meta 'gonear' * scope=testcommandnoun -> Gonear; Verb meta 'purloin' * scope=testcommandnoun -> XPurloin; Verb meta 'random' * -> Predictable; Verb meta 'relations' * -> ShowRelations; Verb meta 'rules' * -> RulesOn * 'all' -> RulesAll * 'off' -> RulesOff; Verb meta 'scenes' * -> ScenesOn * 'off' -> ScenesOff; Verb meta 'scope' * -> Scope * scope=testcommandnoun -> Scope; Verb meta 'showheap' * -> ShowHeap; Verb meta 'showme' * -> ShowMe * scope=testcommandnoun -> ShowMe; Verb meta 'showverb' * special -> Showverb; Verb meta 'test' * -> TestScript * special -> TestScript; Verb meta 'trace' * -> TraceOn * number -> TraceLevel * 'on' -> TraceOn * 'off' -> TraceOff; Verb meta 'tree' * -> XTree * scope=testcommandnoun -> XTree; [ InternalTestCases; ]; #ENDIF; ! DEBUG ! "Include (- ... -)" inclusions with no specified position appear here. [ CheckDPMR result sinp1 sinp2 rv; sinp1 = inp1; sinp2 = inp2; inp1 = noun; inp2 = second; rv = FollowRulebook( 24 ); inp1 = sinp1; inp2 = sinp2; if ((rv) && RulebookSucceeded()) { result = ResultOfRule(); if (result == RBNO_6 ) return 4; if (result == RBNO_7 ) return 3; if (result == RBNO_8 ) return 2; if (result == RBNO_9 ) return 1; if (result == RBNO_10 ) return 0; } return 2; ]; [ LITTLE_USED_DO_NOTHING_R; rfalse; ]; [ ReadChoice low high i; for (::) { print ">> "; KeyboardPrimitive (buffer, parse); i = TryNumber (1); if (i >= low && i <= high) return i; } ]; [ KeyPause i; i = VM_KeyChar(); rfalse; ]; [ SPACEPause i; while (i ~= 13 or 31 or 32) { i = VM_KeyChar(); } ]; [ GetKey i; i = VM_KeyChar(); return i; ]; #ifndef printed_text; Array printed_text buffer 256; #endif; [ CenterPrint str depth i j; font off; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; j = j-1; VM_MoveCursorInStatusLine(depth, j); print (I7_string) str; font on; ]; [ CenterPrintComplex str i j; font off; print "^"; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; spaces j-1; print (I7_string) str; font on; ]; [ I7ScreenHeight i screen_height; i = 0->32; if (screen_height == 0 or 255) screen_height = 18; screen_height = screen_height - 7; return screen_height; ]; [ DeepStatus depth i screen_width; VM_StatusLineHeight(depth); screen_width = VM_ScreenWidth(); style reverse; #ifdef TARGET_GLULX; VM_ClearScreen(1); #ifnot; for (i=1:i52); o = screen_width - n; VM_MoveCursorInStatusLine(depth, o); ]; [ PlugPlural obj; SetPronoun('them', obj); SetPronoun('it', obj); ]; [ text_routine_0; say__p=1;ParaContent(); print (name) real_location; .L_Say292; .L_SayX263; rtrue; ]; [ text_routine_1; say__p=1;ParaContent(); print (say__n=score); ParaContent(); print (PrintText) SC_236; ParaContent(); print (say__n=turns); .L_Say293; .L_SayX264; rtrue; ]; [ text_routine_2; say__p=1;ParaContent(); print (The) second; .L_Say294; .L_SayX265; rtrue; ]; [ text_routine_3; say__p=1;ParaContent(); print (The) (Global_Vars-->57); .L_Say295; .L_SayX266; rtrue; ]; [ text_routine_4; say__p=1;ParaContent(); print (The) (Global_Vars-->63); .L_Say296; .L_SayX267; rtrue; ]; [ text_routine_5; say__p=1;ParaContent(); print (The) (Global_Vars-->64); .L_Say297; .L_SayX268; rtrue; ]; [ text_routine_6; say__p=1;ParaContent(); print (The) noun; .L_Say298; .L_SayX269; rtrue; ]; [ text_routine_7; say__p=1;ParaContent(); (PHR_812());ParaContent(); print (PrintText) SC_237; ParaContent(); STextSubstitution(); ParaContent(); print (PrintText) SC_42; ParaContent(); print (the) (Global_Vars-->64); ParaContent(); print (PrintText) SC_122; .L_Say299; .L_SayX270; rtrue; ]; [ ChronologyPoint pt; for (pt=0:ptpt = present_chronological_record-->pt; ]; [ UPDATE_CHRONOLOGICAL_RECORDS_R pt; for (pt=0: ptpt) & 1; trips = ((past_chronological_record-->pt) & $$11111110)/2; consecutives = ((past_chronological_record-->pt) & $$111111100000000)/256; } else { old = (present_chronological_record-->pt) & 1; trips = ((present_chronological_record-->pt) & $$11111110)/2; consecutives = ((present_chronological_record-->pt) & $$111111100000000)/256; switch(pt) { ! Test cases for conditions by PT number: each sets "new" to whether it is true or false now } if (new == false) { consecutives = 0; } else { if (old == false) { trips++; if (trips > 127) trips = 127; } if (turn_end) { consecutives++; if (consecutives > 127) consecutives = 127; } } ! print pt,":o=",old," n=",new," t=",trips," c=",consecutives,"^"; present_chronological_record-->pt = new + 2*trips + 256*consecutives; } switch(wanted) { 0: if (new) return new; 1: if (new) return trips; 2: if (new) return consecutives; 4: return new; 5: return trips; 6: return consecutives; } return 0; ]; [ PAPR_0; if ((action ==##Examine) && (actor==player) && ((noun == O36_chorus))) rtrue; rfalse; ]; Array PastActionsI6Routines --> PAPR_0 0 0; [ TrackActions readjust ct_0 ct_1 i; for (i=0: PastActionsI6Routines-->i: i++) { if ((PastActionsI6Routines-->i).call()) { ! Yes, the current action matches action pattern i: if (readjust) continue; (TimesActionHasHappened-->i)++; if (LastTurnActionHappenedOn-->i ~= turns + 5) { LastTurnActionHappenedOn-->i = turns + 5; ActionCurrentlyHappeningFlag->i = 1; if (keep_silent == false) (TurnsActionHasBeenHappening-->i)++; } } else { ! No, the current action doesn't match action pattern i: if (keep_silent == false) { TurnsActionHasBeenHappening-->i = 0; } if (LastTurnActionHappenedOn-->i ~= turns + 5) ActionCurrentlyHappeningFlag->i = 0; } } ]; Constant NO_PAST_TENSE_CONDS 0; Constant NO_PAST_TENSE_ACTIONS 1; Array TimesActionHasHappened-->(NO_PAST_TENSE_ACTIONS+1); Array TurnsActionHasBeenHappening-->(NO_PAST_TENSE_ACTIONS+1); Array LastTurnActionHappenedOn-->(NO_PAST_TENSE_ACTIONS+1); Array ActionCurrentlyHappeningFlag->(NO_PAST_TENSE_ACTIONS+1); Array past_chronological_record-->(NO_PAST_TENSE_CONDS+1); Array present_chronological_record-->(NO_PAST_TENSE_CONDS+1); Verb 'take' 'carry' 'hold' * 'inventory' -> Inv * multi -> Take * 'off' noun -> Disrobe * multiinside 'from' noun -> Remove * multiinside 'off' noun -> Remove ; Verb 'get' * 'out' / 'off' / 'up' -> Exit * multi -> Take * 'in' / 'into' / 'on' / 'onto' noun -> Enter * 'off' noun -> GetOff * multiinside 'from' noun -> Remove ; Verb 'pick' * 'up' multi -> Take * multi 'up' -> Take ; Verb 'stand' * -> Exit * 'up' -> Exit * 'on' noun -> Enter ; Verb 'remove' * held -> Disrobe * multiinside 'from' noun -> Remove ; Verb 'shed' 'doff' 'disrobe' * held -> Disrobe ; Verb 'wear' 'don' * held -> Wear ; Verb 'put' * 'on' held -> Wear * 'down' multiheld -> Drop * multiheld 'down' -> Drop * multiexcept 'in' / 'inside' / 'into' noun -> Insert * multiexcept 'on' / 'onto' noun -> PutOn ; Verb 'insert' * multiexcept 'in' / 'into' noun -> Insert ; Verb 'drop' 'throw' 'discard' * multiheld -> Drop * held 'at' / 'against' / 'on' / 'onto' noun -> ThrowAt * multiexcept 'in' / 'into' / 'down' noun -> Insert * multiexcept 'on' / 'onto' noun -> PutOn ; Verb 'give' 'pay' 'offer' 'feed' * creature held -> Give reverse * held 'to' creature -> Give ; Verb 'show' 'present' 'display' * creature held -> Show reverse * held 'to' creature -> Show ; Verb 'go' 'walk' 'run' * -> Go * noun=Noun_Filter_0 -> Go * noun -> Enter * 'into' / 'in' / 'inside' / 'through' noun -> Enter ; Verb 'inventory' 'i//' 'inv' * -> Inv ; Verb 'look' 'l//' * -> Look * 'at' noun -> Examine * 'inside' / 'in' / 'into' / 'through' noun -> Search * 'under' noun -> LookUnder * 'up' topic 'in' noun -> Consult reverse ; Verb 'consult' * noun 'on' / 'about' topic -> Consult ; Verb 'open' 'unwrap' 'uncover' * noun -> Open * noun 'with' held -> Unlock ; Verb 'close' 'shut' 'cover' * noun -> Close * 'up' noun -> Close * 'off' noun -> SwitchOff ; Verb 'enter' 'cross' * noun -> Enter ; Verb 'sit' * 'on' / 'in' / 'inside' noun -> Enter * 'on' 'top' 'of' noun -> Enter ; Verb 'exit' 'leave' 'out' * -> Exit ; Verb 'examine' 'x//' 'watch' 'describe' 'check' * noun -> Examine ; Verb 'read' * noun -> Examine * 'about' topic 'in' noun -> Consult reverse * topic 'in' noun -> Consult reverse ; Verb 'yes' 'y//' * -> Yes ; Verb 'no' * -> No ; Verb 'sorry' * -> Sorry ; Verb 'bother' 'curses' 'drat' 'darn' * -> Mild ; Verb 'shit' 'fuck' 'damn' * -> Strong ; Verb 'search' * noun -> Search ; Verb 'wave' * -> WaveHands * noun -> Wave ; Verb 'set' 'adjust' * noun 'to' topic -> SetTo ; Verb 'pull' 'drag' * noun -> Pull ; Verb 'push' 'move' 'shift' 'clear' 'press' * noun -> Push * noun noun=Noun_Filter_1 -> PushDir * noun 'to' noun=Noun_Filter_2 -> PushDir ; Verb 'turn' 'rotate' 'twist' 'unscrew' 'screw' * noun -> Turn * noun 'on' -> SwitchOn * 'on' noun -> SwitchOn * noun 'off' -> SwitchOff * 'off' noun -> SwitchOff ; Verb 'switch' * noun -> SwitchOn * 'on' noun -> SwitchOn * noun 'on' -> SwitchOn * noun 'off' -> SwitchOff * 'off' noun -> SwitchOff ; Verb 'lock' * noun 'with' held -> Lock ; Verb 'unlock' * noun 'with' held -> Unlock ; Verb 'attack' 'break' 'smash' 'hit' 'fight' 'torture' 'wreck' 'crack' 'destroy' 'murder' 'kill' 'punch' 'thump' * noun -> Attack ; Verb 'wait' 'z//' * -> Wait ; Verb 'answer' 'say' 'shout' 'speak' * topic 'to' creature -> Answer reverse ; Verb 'tell' * creature 'about' topic -> Tell ; Verb 'ask' * creature 'for' noun -> AskFor * creature 'about' topic -> Ask ; Verb 'eat' * held -> Eat ; Verb 'sleep' 'nap' * -> Sleep ; Verb 'sing' * -> Sing ; Verb 'climb' 'scale' * noun -> Climb * 'up' / 'over' noun -> Climb ; Verb 'buy' 'purchase' * noun -> Buy ; Verb 'squeeze' 'squash' * noun -> Squeeze ; Verb 'swing' * noun -> Swing * 'on' noun -> Swing ; Verb 'wake' 'awake' 'awaken' * -> Wake * 'up' -> Wake * creature -> WakeOther * creature 'up' -> WakeOther * 'up' creature -> WakeOther ; Verb 'kiss' 'embrace' 'hug' * creature -> Kiss ; Verb 'think' * -> Think ; Verb 'smell' 'sniff' * -> Smell * noun -> Smell ; Verb 'listen' * -> Listen * 'to' noun -> Listen ; Verb 'hear' * noun -> Listen ; Verb 'taste' * noun -> Taste ; Verb 'touch' 'feel' * noun -> Touch ; Verb 'rub' 'shine' 'polish' 'sweep' 'clean' 'dust' 'wipe' 'scrub' * noun -> Rub ; Verb 'tie' 'attach' 'fix' 'fasten' * noun 'to' noun -> Tie ; Verb 'burn' 'light' * noun -> Burn ; Verb 'drink' 'swallow' 'sip' * noun -> Drink ; Verb 'cut' 'slice' 'prune' 'chop' * noun -> Cut ; Verb 'jump' 'skip' 'hop' * -> Jump ; Verb 'score' * -> Score ; Verb 'quit' * -> Quit ; Verb 'q//' * -> Quit ; Verb 'save' * -> Save ; Verb 'restart' * -> Restart ; Verb 'restore' * -> Restore ; Verb 'verify' * -> Verify ; Verb 'version' * -> Version ; Verb 'script' * -> ScriptOn * 'on' -> ScriptOn * 'off' -> ScriptOff ; Verb 'transcript' * -> ScriptOn * 'on' -> ScriptOn * 'off' -> ScriptOff ; Verb 'superbrief' * -> LMode3 ; Verb 'short' * -> LMode3 ; Verb 'verbose' * -> LMode2 ; Verb 'long' * -> LMode2 ; Verb 'brief' * -> LMode1 ; Verb 'normal' * -> LMode1 ; Verb 'nouns' * -> Pronouns ; Verb 'pronouns' * -> Pronouns ; Verb 'notify' * -> NotifyOn * 'on' -> NotifyOn * 'off' -> NotifyOff ; Verb 'numbers' * 'off' -> A84_switching_the_numbers_of * 'on' -> A85_switching_the_numbers_on ; Verb 'a//' * noun=Noun_Filter_3 -> Attack ; Verb 'concentrate' * -> A86_concentrating ; Verb 'c//' * -> A86_concentrating ; Verb 'parry' * -> A87_parrying ; Verb 'p//' * -> A87_parrying ; Verb 'dodge' * -> A88_dodging ; Verb 'do' * -> A88_dodging ; Verb 'ready' * noun=Noun_Filter_4 -> A89_readying ; Verb 'reload' * noun=Noun_Filter_5 -> A90_reloading ; [ Parse_Name_GV1 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV2 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV3 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV4 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV5 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV6 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV7 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV8 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV9 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV10 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV11 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV12 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV95 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Parse_Name_GV106 original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction try_from_wn ! position to try matching from n ! number of words matched f ! flag: sufficiently good match found to justify success w ! for use by individual grammar lines rv ! for use by individual grammar lines g ! temporary: success flag for parsing visibles ss ! temporary: saves 'self' in distinguishing visibles spn ! temporary: saves 'parsed_number' in parsing visibles pass ! pass counter (1 or 2) pass1_n ! value of n recorded during pass 1 ; if (parser_trace >= 3) print "Two-pass parse_name called^"; original_wn = wn; for (pass = 1: pass <= 2: pass++) { wn = original_wn; try_from_wn = wn; f = false; n = 0; ! On pass 1 only, advance wn past name property words ! (but do not do this for ##TheSame, when wn is undefined) if ((parser_action ~= ##TheSame) && (pass == 1)) { while (WordInProperty(NextWordStopped(), self, name)) f = true; wn--; try_from_wn = wn; } ! On pass 2 only, match name property words at end if (pass == 2) while (WordInProperty(NextWordStopped(), self, name)) n++; if ((f) || (n>0)) n = n + try_from_wn - original_wn; if (pass == 1) pass1_n = n; } ! End of pass loop if (parser_trace >= 3) print "Pass 1: ", pass1_n, " Pass 2: ", n, "^"; if (pass1_n > n) n = pass1_n; wn = original_wn + n; if (n == 0) return -1; DetectPluralWord(original_wn, n); return n; ]; [ Consult_Grammar_107 range_from ! call parameter: word number of snippet start range_words ! call parameter: snippet length original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction w ! for use by individual grammar lines rv ! for use by individual grammar lines ; wn = range_from; original_wn = wn; rv = GPR_PREPOSITION; if (NextWordStopped() ~= 'restart') jump Fail_1; if ((range_words==0) || (wn-range_from==range_words)) return rv; .Fail_1; rv = GPR_PREPOSITION; wn = original_wn; return GPR_FAIL; ]; [ Consult_Grammar_108 range_from ! call parameter: word number of snippet start range_words ! call parameter: snippet length original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction w ! for use by individual grammar lines rv ! for use by individual grammar lines ; wn = range_from; original_wn = wn; rv = GPR_PREPOSITION; if (NextWordStopped() ~= 'restore') jump Fail_1; if ((range_words==0) || (wn-range_from==range_words)) return rv; .Fail_1; rv = GPR_PREPOSITION; wn = original_wn; return GPR_FAIL; ]; [ Consult_Grammar_109 range_from ! call parameter: word number of snippet start range_words ! call parameter: snippet length original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction w ! for use by individual grammar lines rv ! for use by individual grammar lines ; wn = range_from; original_wn = wn; rv = GPR_PREPOSITION; if (NextWordStopped() ~= 'amusing') jump Fail_1; if ((range_words==0) || (wn-range_from==range_words)) return rv; .Fail_1; rv = GPR_PREPOSITION; wn = original_wn; return GPR_FAIL; ]; [ Consult_Grammar_110 range_from ! call parameter: word number of snippet start range_words ! call parameter: snippet length original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction w ! for use by individual grammar lines rv ! for use by individual grammar lines ; wn = range_from; original_wn = wn; rv = GPR_PREPOSITION; if (NextWordStopped() ~= 'quit') jump Fail_1; if ((range_words==0) || (wn-range_from==range_words)) return rv; .Fail_1; rv = GPR_PREPOSITION; wn = original_wn; return GPR_FAIL; ]; [ Consult_Grammar_111 range_from ! call parameter: word number of snippet start range_words ! call parameter: snippet length original_wn ! first word of text parsed group_wn ! first word matched against A/B/C/... disjunction w ! for use by individual grammar lines rv ! for use by individual grammar lines ; wn = range_from; original_wn = wn; rv = GPR_PREPOSITION; if (NextWordStopped() ~= 'undo') jump Fail_1; if ((range_words==0) || (wn-range_from==range_words)) return rv; .Fail_1; rv = GPR_PREPOSITION; wn = original_wn; return GPR_FAIL; ]; #IFTRUE (0 == 1); [ UnknownVerb; verb_wordnum = 0; return 'no.verb'; ]; [ PrintVerb v; if (v == 'no.verb') { print "do something to"; rtrue; } rfalse; ]; #Ifnot; [ UnknownVerb; rfalse; ]; [ PrintVerb v; rfalse; ]; #ENDIF; ! Find next x satisfying: ! [ person(x) & 'alive'(x) & encloses('location', x) ] ! in 'repeat with x running through all alive persons enclosed by the location begin' [ Prop_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if ((Adj_20_t1_v64(x)) && (IndirectlyContains(real_location,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ weapon(x) & encloses('global attacker', x) ] ! in 'repeat with x running through all weapons enclosed by the global attacker begin' [ Prop_1 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK31_First: x: x=x.IK31_Link){ if ((IndirectlyContains((Global_Vars-->63),x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('global attacker', x) ] ! in 'now the global attacker weapon is a random readied weapon enclosed by the global attacker' [ Prop_2 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->63),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('global defender', x) ] ! in 'now the global defender weapon is a random readied weapon enclosed by the global defender' [ Prop_3 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->64),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find next x satisfying: ! [ person(x) & 'alive'(x) & encloses('location', x) ] ! in 'repeat with x running through all alive persons enclosed by the location begin' [ Prop_4 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if ((Adj_20_t1_v64(x)) && (IndirectlyContains(real_location,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! How many x satisfy this? ! [ person(x) & pressing(x, const_0) ] ! in 'now the move order entry is the number of persons pressing x' [ Prop_5 const_0 x x_ix counter; for (x=IK8_First: x: x=x.IK8_Link){ if (((Relation_TestVtoV(x,V2V_Bitmap_67,const_0,false)))){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! Find next x satisfying: ! [ person(x) & pressing(const_0, x) ] ! in 'repeat with x running through all persons pressed by a begin' [ Prop_6 const_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if (((Relation_TestVtoV(const_0,V2V_Bitmap_67,x,false)))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ person(x) & 'alive'(x) & encloses('location', x) ] ! in 'repeat with x running through alive persons enclosed by the location begin' [ Prop_7 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if ((Adj_20_t1_v64(x)) && (IndirectlyContains(real_location,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ person(x) ] ! in 'repeat with the patient running through people begin' [ Prop_8 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ return x; .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ person(x) ] ! in 'repeat with the patient running through people begin' [ Prop_9 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ return x; .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ person(x) & 'alive'(x) & encloses('location', x) ] ! in 'repeat with x running through all alive persons enclosed by the location begin' [ Prop_10 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if ((Adj_20_t1_v64(x)) && (IndirectlyContains(real_location,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! True or false? ! [ DoesNotExist x IN[ weapon(x) & 'readied'(x) IN] : encloses(const_0, x) ] ! in 'if x encloses no readied weapon begin' [ Prop_11 const_0 x x_ix qcy_0 qcn_0 ; qcy_0 = 0; qcn_0 = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x))){ qcn_0++; if ((IndirectlyContains(const_0,x))){ qcy_0++; } } } if (qcy_0 == 0){ rtrue; } rfalse; ]; ! Find a random x satisfying: ! [ natural weapon(x) & is(const_0, (x.component_parent)) ] ! in 'let item be a random natural weapon part of x' [ Prop_12 const_0 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK32_First: x: x=x.IK32_Link){ if ((const_0 == (x.component_parent))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find next x satisfying: ! [ thing(x) ] ! in 'repeat with item running through things begin' [ Prop_13 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ return x; .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ thing(x) ] ! in 'repeat with item running through things begin' [ Prop_14 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ return x; .NextOuterLoop_4; } return nothing; ]; ! Find next x satisfying: ! [ thing(x) ] ! in 'repeat with item running through things begin' [ Prop_15 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ return x; .NextOuterLoop_4; } return nothing; ]; ! How many x satisfy this? ! [ thing(x) & 'marked for listing'(x) ] ! in 'if the number of marked for listing things is 0 begin' [ Prop_16 x x_ix counter; for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_46_t1_v64(x))){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! Find next x satisfying: ! [ thing(x) & 'marked for listing'(x) ] ! in 'repeat with list item running through marked for listing things begin' [ Prop_17 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_46_t1_v64(x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Abstraction for set of x such that: ! [ thing(x) & 'unmentioned'(x) ] ! in 'filter list recursion to unmentioned things' [ Prop_18 reason x x_ix total counter selection best best_with; if (reason >= 0) { x = reason; reason = -1; } switch (reason) { -6: ! Find the extremal x satisfying: if (property_loop_sign>0) best=MIN_NEGATIVE_NUMBER; else best=MAX_POSITIVE_NUMBER; for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_49_t1_v64(x))){ if (property_loop_sign>0) { if (x.property_to_be_totalled >= best) { best = x.property_to_be_totalled; best_with = x; } } else { if (x.property_to_be_totalled <= best) { best = x.property_to_be_totalled; best_with = x; } } } .NextOuterLoop_3; } return best_with; -5: ! Find a total property value over all x satisfying: for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_49_t1_v64(x))){ total = total + x.property_to_be_totalled; jump NextOuterLoop_6; } .NextOuterLoop_6; } return total; -4: ! Find a random x satisfying: selection = -1; while (true) { counter = 0; for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_49_t1_v64(x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } -3: ! How many x satisfy this? for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_49_t1_v64(x))){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; -2: ! Find next x satisfying: if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ if ((Adj_49_t1_v64(x))){ return x; } .NextOuterLoop_4; } return nothing; -1: ! True or false? if ((x ofclass K2_thing) && (Adj_49_t1_v64(x))){ rtrue; } rfalse; } ]; ! True or false? ! [ Exists x : thing(x) & 'locale-supportable'(x) & is(const_0, SupporterOf(x)) ] ! in 'if a locale-supportable thing is on the item begin' [ Prop_19 const_0 x x_ix ; objectloop (x in const_0) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing) && (Adj_19_t1_v64(x))){ rtrue; } } rfalse; ]; ! Find next x satisfying: ! [ thing(x) & is(const_0, SupporterOf(x)) ] ! in 'repeat with possibility running through things on the item begin' [ Prop_20 const_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; objectloop (x in const_0) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing)){ return x; } .NextOuterLoop_4; } return nothing; ]; ! True or false? ! [ Exists x : thing(x) & 'locale-supportable'(x) & is(const_0, SupporterOf(x)) ] ! in 'if a locale-supportable thing is on the item begin' [ Prop_21 const_0 x x_ix ; objectloop (x in const_0) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing) && (Adj_19_t1_v64(x))){ rtrue; } } rfalse; ]; ! Find next x satisfying: ! [ thing(x) & is(const_0, SupporterOf(x)) ] ! in 'repeat with possibility running through things on the item begin' [ Prop_22 const_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; objectloop (x in const_0) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing)){ return x; } .NextOuterLoop_4; } return nothing; ]; ! How many x satisfy this? ! [ thing(x) & is(const_0, CarrierOf(x)) ] ! in 'if the number of things carried by the actor is at least the carrying capacity of the actor begin' [ Prop_23 const_0 x x_ix counter; objectloop (x in const_0) if (CarrierOf(x)==parent(x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! True or false? ! [ Exists x : player's holdall(x) & called='current working sack'(x) & is(const_0, HolderOf(x)) ] ! in 'if the actor is holding a player's holdall ( called the current working sack ) begin' [ Prop_24 const_0 x x_ix ; for (x=nothing: false: ){ if ((const_0 == HolderOf(x))){ deferred_calling_list-->0 = x; rtrue; } } rfalse; ]; ! Find next x satisfying: ! [ thing(x) & is(const_0, CarrierOf(x)) ] ! in 'repeat with the possible item running through things carried by the actor begin' [ Prop_25 const_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; objectloop (x in const_0) if (CarrierOf(x)==parent(x)){ if ((x ofclass K2_thing)){ return x; } .NextOuterLoop_4; } return nothing; ]; ! How many x satisfy this? ! [ thing(x) & is(const_0, CarrierOf(x)) ] ! in 'if the number of things carried by the actor is at least the carrying capacity of the actor , stop the action with library message taking action number 12 for the actor' [ Prop_26 const_0 x x_ix counter; objectloop (x in const_0) if (CarrierOf(x)==parent(x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! How many x satisfy this? ! [ thing(x) & is(const_0, SupporterOf(x)) ] ! in 'if the number of things on h is at least the carrying capacity of h begin' [ Prop_27 const_0 x x_ix counter; objectloop (x in const_0) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! How many x satisfy this? ! [ thing(x) & is(const_0, ContainerOf(x)) ] ! in 'if the number of things in h is at least the carrying capacity of h begin' [ Prop_28 const_0 x x_ix counter; for (x=TestContainmentRange(const_0): x: x=TestContainmentRange(const_0,x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! How many x satisfy this? ! [ thing(x) & is('second noun', SupporterOf(x)) ] ! in 'if the number of things on the second noun is at least the carrying capacity of the second noun , stop the action with library message putting it on action number 6 for the second noun' [ Prop_29 x x_ix counter; objectloop (x in second) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! How many x satisfy this? ! [ thing(x) & is('second noun', ContainerOf(x)) ] ! in 'if the number of things in the second noun is at least the carrying capacity of the second noun , stop the action with library message inserting it into action number 7 for the second noun' [ Prop_30 x x_ix counter; for (x=TestContainmentRange(second): x: x=TestContainmentRange(second,x)){ if ((x ofclass K2_thing)){ counter++; jump NextOuterLoop_5; } .NextOuterLoop_5; } return counter; ]; ! True or false? ! [ Exists x : thing(x) & 'described'(x) & NOT[ 'scenery'(x) NOT] & is('noun', ContainerOf(x)) ] ! in 'if the noun contains a described thing which is not scenery , issue library message searching action number 7 for the noun' [ Prop_31 x x_ix ; for (x=TestContainmentRange(noun): x: x=TestContainmentRange(noun,x)){ if ((x ofclass K2_thing) && (Adj_44_t1_v64(x))){ if (~~((Adj_35_t1_v64(x)))){ rtrue; } } } rfalse; ]; ! True or false? ! [ Exists x : thing(x) & 'described'(x) & NOT[ 'scenery'(x) NOT] & is('noun', SupporterOf(x)) ] ! in 'if the noun supports a described thing which is not scenery , issue library message searching action number 3 for the noun' [ Prop_32 x x_ix ; objectloop (x in noun) if (SupporterOf(x)==parent(x)){ if ((x ofclass K2_thing) && (Adj_44_t1_v64(x))){ if (~~((Adj_35_t1_v64(x)))){ rtrue; } } } rfalse; ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('player', x) ] ! in 'let item be a random readied weapon enclosed by the player' [ Prop_33 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains(player,x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('global attacker', x) ] ! in 'let item be a random readied weapon enclosed by the global attacker' [ Prop_34 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->63),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('stored_person', x) ] ! in 'let item be a random readied weapon enclosed by the stored_person' [ Prop_35 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->74),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('global attacker', x) ] ! in 'let item be a random readied weapon enclosed by the global attacker' [ Prop_36 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->63),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('global attacker', x) ] ! in 'let item be a random readied weapon enclosed by the global attacker' [ Prop_37 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->63),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses('stored_person', x) ] ! in 'let item2 be a random readied weapon enclosed by the stored_person' [ Prop_38 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains((Global_Vars-->74),x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find next x satisfying: ! [ person(x) & 'alive'(x) & encloses('location', x) ] ! in 'repeat with x running through alive persons enclosed by the location begin' [ Prop_39 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK8_First: x: x=x.IK8_Link){ if ((Adj_20_t1_v64(x)) && (IndirectlyContains(real_location,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; ! Find a random x satisfying: ! [ weapon(x) & 'readied'(x) & encloses(const_0, x) ] ! in 'let item be a random readied weapon enclosed by x' [ Prop_40 const_0 x x_ix counter selection; selection = -1; while (true) { counter = 0; for (x=IK31_First: x: x=x.IK31_Link){ if ((Adj_81_t1_v64(x)) && (IndirectlyContains(const_0,x))){ counter++; if (counter == selection) return x; jump NextOuterLoop_7; } .NextOuterLoop_7; } if ((counter == 0) || (selection >= 0)) return nothing; selection = random(counter); } ]; ! Find next x satisfying: ! [ thing(x) & encloses(const_0, x) ] ! in 'repeat with item running through things enclosed by the actor begin' [ Prop_41 const_0 x x_ix ; if (x_ix > 0) { x_ix--; jump NextOuterLoop_4; } if (x) jump NextOuterLoop_4; for (x=IK2_First: x: x=x.IK2_Link){ if ((IndirectlyContains(const_0,x))){ return x; } .NextOuterLoop_4; } return nothing; ]; [ Resolver_0 t_0 t_1 filename line; if ((((t_0 ofclass K3_direction)))) { return RoomOrDoorFrom(t_1,t_0) ; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_1 t_0 t_1 filename line; if ((((t_0 ofclass K4_door)))) { return OtherSideOfDoor(t_0,t_1) ; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_2 t_0 filename line; if ((((t_0 ofclass K2_thing)))) { (PHR_754(t_0)); rtrue; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_3 t_0 t_1 filename line; if ((((t_0 ofclass K3_direction))) && (((t_1 ofclass K1_room)))) { return MapConnection(t_1,t_0) ; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_4 t_0 t_1 filename line; if ((((t_0 ofclass K3_direction)))) { return MapConnection(t_1,t_0) ; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_5 t_0 t_1 filename line; if ((((t_1 ofclass K1_room)))) { return RoomOrDoorFrom(t_1,t_0) ; } ArgumentTypeFailed(filename, line); rfalse; ]; [ Resolver_6 t_0 t_1 filename line; if ((((t_1 ofclass K8_person)))) { (PHR_838(t_0,t_1)); rtrue; } ArgumentTypeFailed(filename, line); rfalse; ]; Array ConstantListPointers --> 0 0; Constant SC_42 = " "; Constant SC_143 = " ("; Constant SC_177 = " (concentration)"; Constant SC_187 = " (defender dodging)"; Constant SC_184 = " (defender parrying)"; Constant SC_146 = " (no ammo; "; Constant SC_142 = " (readied)"; Constant SC_176 = " + "; Constant SC_178 = " + 1 (dodge bonus)"; Constant SC_182 = " + 2 (charging)"; Constant SC_198 = " + 3 (both attacking)"; Constant SC_199 = " + 4 (charging)"; Constant SC_180 = " - "; Constant SC_188 = " - 0 (cannot dodge)"; Constant SC_186 = " - 0 (cannot parry against "; Constant SC_185 = " - 0 (cannot parry with "; Constant SC_183 = " - 1 (defensive move)"; Constant SC_189 = " = "; Constant SC_40 = " You lose your "; Constant SC_137 = " and "; Constant SC_105 = " average"; Constant SC_103 = " bad"; Constant SC_191 = " beats "; Constant SC_179 = " bonus)"; Constant SC_226 = " cannot be reloaded."; Constant SC_210 = " concentrate"; Constant SC_200 = " damage"; Constant SC_197 = " deals "; Constant SC_192 = " defence rating of "; Constant SC_194 = " does "; Constant SC_225 = " does not use ammo."; Constant SC_107 = " excellent"; Constant SC_217 = " get"; Constant SC_106 = " good"; Constant SC_206 = " health."; Constant SC_160 = " here"; Constant SC_220 = " hit"; Constant SC_74 = " is "; Constant SC_167 = " is already dead."; Constant SC_227 = " is already loaded."; Constant SC_169 = " is not your enemy."; Constant SC_168 = " is your friend, not your enemy!"; Constant SC_237 = " kill"; Constant SC_19 = " lose "; Constant SC_43 = " loses "; Constant SC_223 = " lung"; Constant SC_221 = " miss"; Constant SC_120 = " none"; Constant SC_214 = " now maximally concentrated."; Constant SC_212 = " now mildly concentrated."; Constant SC_213 = " now quite concentrated."; Constant SC_144 = " of "; Constant SC_151 = " or "; Constant SC_181 = " penalty)"; Constant SC_219 = " read"; Constant SC_218 = " ready for quick evasive maneuvers."; Constant SC_235 = " reloading "; Constant SC_230 = " reloading"; Constant SC_147 = " rounds to reload)"; Constant SC_145 = " shots left)"; Constant SC_215 = " strike"; Constant SC_232 = " the old ammo, and "; Constant SC_205 = " to "; Constant SC_98 = " to dodge, "; Constant SC_202 = " to escape unscathed."; Constant SC_100 = " to parry against. "; Constant SC_224 = " towards "; Constant SC_216 = " up a defensive pose."; Constant SC_102 = " very bad"; Constant SC_108 = " weapon to parry with. "; Constant SC_155 = " you "; Constant SC_41 = "!"; Constant SC_44 = "(Your health increases by "; Constant SC_18 = "(making "; Constant SC_15 = "(making you lose your "; Constant SC_21 = "(or 0 to say nothing)"; Constant SC_20 = ") "; Constant SC_17 = ")"; Constant SC_81 = ", "; Constant SC_211 = ", and "; Constant SC_130 = ", feeling the exhilaration of achievement while being assured of continuous progress!"; Constant SC_126 = ", slaughtering my enemies without having to face the possibility of defeat!"; Constant SC_133 = ", so I can rejoice in my superiority when I look down on the corpses of my enemies!"; Constant SC_150 = ","; Constant SC_90 = ". "; Constant SC_122 = "."; Constant SC_45 = ".)"; Constant SC_236 = "/"; Constant SC_115 = ": "; Constant SC_161 = ":"; Constant SC_152 = "> "; Constant SC_4 = ">"; Constant SC_149 = "?"; Constant SC_10 = "A description of the megaron will be shown here."; Constant SC_72 = "Active parry max:"; Constant SC_127 = "And would you like to see all the numbers involved in tactical combat, or just the prose descriptions?"; Constant SC_6 = "As good-looking as ever."; Constant SC_68 = "Attack bonus:"; Constant SC_141 = "Bronze-tipped and eight feet long."; Constant SC_140 = "Clenched fists, kicking feet--that kind of stuff."; Constant SC_69 = "Damage die:"; Constant SC_70 = "Dodgability:"; Constant SC_172 = "Error: no link text for "; Constant SC_171 = "Error: no text for "; Constant SC_28 = "He"; Constant SC_112 = "Health"; Constant SC_165 = "Helios dazzles you as you step outside into the courtyard. We follow you."; Constant SC_25 = "Her"; Constant SC_5 = "Here you have slept away the years of injustice. Now only the large chest in the corner interests you, and the door leading south to the rest of the Palace of Phocis."; Constant SC_36 = "Hers"; Constant SC_116 = "Hi, Orestes! We are your very own chorus of libation bearers, and cute-looking maidens to boot."; Constant SC_24 = "Him"; Constant SC_32 = "His"; Constant SC_162 = "How could you leave without your sword, Orestes?"; Constant SC_139 = "I don't understand. How can I min-max without numbers?"; Constant SC_124 = "I want to go on a "; Constant SC_128 = "I want to have a "; Constant SC_131 = "I want to play "; Constant SC_154 = "In "; Constant SC_101 = "In addition, it is a"; Constant SC_121 = "It has no special effects"; Constant SC_91 = "It is "; Constant SC_163 = "It is a dangerous world, Orestes. You should ready your sword."; Constant SC_118 = "It is as sharp as any piece of iron you are likely to find."; Constant SC_26 = "It"; Constant SC_33 = "Its"; Constant SC_2 = "Libation bearers"; Constant SC_134 = "Numbers scare me! I am a casual gamer!"; Constant SC_156 = "On "; Constant SC_114 = "Orestes, wake up! Wake up, son of Agamemnon! And be of good cheer, for the day of your dreams has finally come."; Constant SC_71 = "Passive parry max:"; Constant SC_111 = "Please press SPACE to continue."; Constant SC_14 = "QUIT"; Constant SC_11 = "RESTART"; Constant SC_12 = "RESTORE a saved game"; Constant SC_175 = "Rolling "; Constant SC_29 = "She"; Constant SC_119 = "Special effects:"; Constant SC_123 = "Tell us, Orestes, how difficult do you want your adventure to be?"; Constant SC_39 = "That"; Constant SC_73 = "The attack bonus of "; Constant SC_8 = "The entrance gate of the palace lies west, while the gallery that leads to the megaron is east. You can access your room to the north."; Constant SC_9 = "The gate. Lions."; Constant SC_30 = "Their"; Constant SC_34 = "Theirs"; Constant SC_22 = "Them"; Constant SC_27 = "They"; Constant SC_166 = "Things are not your enemies."; Constant SC_38 = "Those"; Constant SC_164 = "To ready a weapon, type ~ready~ followed by the name of the weapon. When you attack, you will always use your readied weapon. If you have no weapon readied, you will attack with your bare hands--not a very strategic choice. You can check which weapon is readied by taking inventory"; Constant SC_135 = "Very well. You can always switch by typing "; Constant SC_3 = "Victor Gijsbers"; Constant SC_117 = "We wave and smile at you. You are our hero!"; Constant SC_148 = "Would you like to "; Constant SC_153 = "You "; Constant SC_222 = "You are killed by "; Constant SC_196 = "You deal "; Constant SC_170 = "You pull the trigger, but nothing happens--you're out of ammo!"; Constant SC_173 = "You will no longer see combat-related numbers."; Constant SC_174 = "You will now see combat-related numbers."; Constant SC_23 = "You"; Constant SC_7 = "Your sword stands against the wall, beckoning."; Constant SC_31 = "Your"; Constant SC_35 = "Yours"; Constant SC_86 = "above average"; Constant SC_201 = "allowing "; Constant SC_203 = "allowing you to escape unscathed."; Constant SC_158 = "also "; Constant SC_99 = "and "; Constant SC_82 = "and its damage is "; Constant SC_51 = "are"; Constant SC_85 = "average"; Constant SC_76 = "bad"; Constant SC_157 = "can "; Constant SC_16 = "concentration"; Constant SC_234 = "continue"; Constant SC_231 = "discard"; Constant SC_96 = "easy"; Constant SC_46 = "es"; Constant SC_129 = "fair fight"; Constant SC_80 = "fantastic"; Constant SC_229 = "finish"; Constant SC_78 = "good"; Constant SC_132 = "hard core"; Constant SC_93 = "hard"; Constant SC_48 = "has"; Constant SC_47 = "have"; Constant SC_59 = "he"; Constant SC_113 = "health"; Constant SC_56 = "her"; Constant SC_67 = "hers"; Constant SC_87 = "high"; Constant SC_55 = "him"; Constant SC_63 = "his"; Constant SC_50 = "ies"; Constant SC_89 = "incredible"; Constant SC_52 = "is"; Constant SC_57 = "it"; Constant SC_64 = "its"; Constant SC_208 = "killing "; Constant SC_209 = "killing you."; Constant SC_84 = "low"; Constant SC_104 = "n"; Constant SC_77 = "normal"; Constant SC_95 = "normally difficult"; Constant SC_195 = "not overcome "; Constant SC_136 = "numbers off"; Constant SC_138 = "numbers on"; Constant SC_125 = "power trip"; Constant SC_94 = "quite hard"; Constant SC_228 = "reload"; Constant SC_37 = "s"; Constant SC_159 = "see "; Constant SC_13 = "see some suggestions for AMUSING things to do"; Constant SC_60 = "she"; Constant SC_233 = "start"; Constant SC_110 = "that"; Constant SC_61 = "their"; Constant SC_65 = "theirs"; Constant SC_53 = "them"; Constant SC_58 = "they"; Constant SC_109 = "those"; Constant SC_75 = "very bad"; Constant SC_97 = "very easy"; Constant SC_79 = "very good"; Constant SC_92 = "very hard"; Constant SC_88 = "very high"; Constant SC_83 = "very low"; Constant SC_204 = "wounding "; Constant SC_207 = "wounding you to "; Constant SC_49 = "y"; Constant SC_190 = "you beat "; Constant SC_193 = "you do "; Constant SC_54 = "you"; Constant SC_62 = "your"; Constant SC_66 = "yours"; #ifndef description; Constant description = 0; #endif; #ifndef short_name; Constant short_name = 0; #endif; #ifndef map_region; Constant map_region = 0; #endif; #ifndef article; Constant article = 0; #endif; #ifndef initial; Constant initial = 0; #endif; #ifndef plural; Constant plural = 0; #endif; #ifndef p6_opposite; Constant p6_opposite = 0; #endif; #ifndef door_to; Constant door_to = 0; #endif; #ifndef capacity; Constant capacity = 0; #endif; #ifndef with_key; Constant with_key = 0; #endif; #ifndef p10_health; Constant p10_health = 0; #endif; #ifndef p11_permanent_health; Constant p11_permanent_health = 0; #endif; #ifndef p12_gained_health; Constant p12_gained_health = 0; #endif; #ifndef p13_melee; Constant p13_melee = 0; #endif; #ifndef p14_defence; Constant p14_defence = 0; #endif; #ifndef p15_damage_die; Constant p15_damage_die = 0; #endif; #ifndef p16_initiative_modifier; Constant p16_initiative_modifier = 0; #endif; #ifndef p17_concentration; Constant p17_concentration = 0; #endif; #ifndef p18_combat_ai_rulebook; Constant p18_combat_ai_rulebook = 0; #endif; #ifndef p19_dodgability; Constant p19_dodgability = 0; #endif; #ifndef p20_passive_parry_max; Constant p20_passive_parry_max = 0; #endif; #ifndef p21_active_parry_max; Constant p21_active_parry_max = 0; #endif; #ifndef p22_weapon_attack_bonus; Constant p22_weapon_attack_bonus = 0; #endif; #ifndef p23_maximum_shots; Constant p23_maximum_shots = 0; #endif; #ifndef p24_current_shots; Constant p24_current_shots = 0; #endif; #ifndef p25_maximum_load_time; Constant p25_maximum_load_time = 0; #endif; #ifndef p26_current_load_time; Constant p26_current_load_time = 0; #endif; #ifndef privately_named; Constant privately_named = 0; #endif; #ifndef light; Constant light = 0; #endif; #ifndef visited; Constant visited = 0; #endif; #ifndef light; Constant light = 0; #endif; #ifndef edible; Constant edible = 0; #endif; #ifndef static; Constant static = 0; #endif; #ifndef scenery; Constant scenery = 0; #endif; #ifndef clothing; Constant clothing = 0; #endif; #ifndef pushable; Constant pushable = 0; #endif; #ifndef moved; Constant moved = 0; #endif; #ifndef initially_carried; Constant initially_carried = 0; #endif; #ifndef pluralname; Constant pluralname = 0; #endif; #ifndef proper; Constant proper = 0; #endif; #ifndef concealed; Constant concealed = 0; #endif; #ifndef workflag; Constant workflag = 0; #endif; #ifndef mentioned; Constant mentioned = 0; #endif; #ifndef enterable; Constant enterable = 0; #endif; #ifndef transparent; Constant transparent = 0; #endif; #ifndef open; Constant open = 0; #endif; #ifndef openable; Constant openable = 0; #endif; #ifndef lockable; Constant lockable = 0; #endif; #ifndef locked; Constant locked = 0; #endif; #ifndef female; Constant female = 0; #endif; #ifndef neuter; Constant neuter = 0; #endif; #ifndef on; Constant on = 0; #endif; #ifndef p69_recurring; Constant p69_recurring = 0; #endif; #ifndef p71_activation_relates; Constant p71_activation_relates = 0; #endif; #ifndef p72_ambiguously_plural; Constant p72_ambiguously_plural = 0; #endif; #ifndef p74_hostility; Constant p74_hostility = 0; #endif; #ifndef p75_pressing_relates; Constant p75_pressing_relates = 0; #endif; #ifndef p76_combat_state; Constant p76_combat_state = 0; #endif; #ifndef p77_react_state; Constant p77_react_state = 0; #endif; #ifndef p78_readied; Constant p78_readied = 0; #endif; #ifndef p80_at_parry; Constant p80_at_parry = 0; #endif; #ifndef p82_at_dodge; Constant p82_at_dodge = 0; #endif; #ifndef p84_specification; Constant p84_specification = 0; #endif; #ifndef relation_index_L65; Constant relation_index_L65 = 0; #endif;#ifndef relation_index_R65; Constant relation_index_R65 = 0; #endif;#ifndef relation_index_L67; Constant relation_index_L67 = 0; #endif;#ifndef relation_index_R67; Constant relation_index_R67 = 0; #endif;Constant FBNA_PROP_NUMBER = 10000; #IFNDEF cap_short_name; Constant cap_short_name = short_name; #ENDIF; Array Runtime_Quotations_Displayed --> 1; [ InitialHeapAllocation obj pv; pv = (Global_Vars-->76); if (pv==0) (Global_Vars-->76) = BlkValueCreate(84,pv,0); for (obj=1:obj<=TableRows(T5_stored_combat_actions):obj++) { if (ExistsTableLookUpEntry(T5_stored_combat_actions, 2, obj)==false) continue; pv = TableLookUpEntry(T5_stored_combat_actions, 2, obj); if (pv==0) TableLookUpEntry(T5_stored_combat_actions, 2, obj, true, BlkValueCreate(84,pv,0)); } for (obj=1:obj<=TableRows(T7_ai_combat_options):obj++) { if (ExistsTableLookUpEntry(T7_ai_combat_options, 1, obj)==false) continue; pv = TableLookUpEntry(T7_ai_combat_options, 1, obj); if (pv==0) TableLookUpEntry(T7_ai_combat_options, 1, obj, true, BlkValueCreate(84,pv,0)); } ]; [ DistributeBlockConstants obj pv; ]; #ifdef TARGET_ZCODE; Constant MEMORY_HEAP_SIZE = 8192; #ifnot; Constant MEMORY_HEAP_SIZE = 32768; #endif; #IFDEF MEMORY_HEAP_SIZE; ! Constant SHOW_ALLOCATIONS = 1; ! Uncomment this for debugging purposes Constant BLK_HEADER_N = 0; Constant BLK_HEADER_FLAGS = 1; Constant BLK_FLAG_MULTIPLE = $$00000001; Constant BLK_FLAG_16_BIT = $$00000010; Constant BLK_FLAG_WORD = $$00000100; Constant BLK_HEADER_KOV = 1; Constant BLK_DATA_OFFSET = 2*WORDSIZE; Constant BLK_DATA_MULTI_OFFSET = 4*WORDSIZE; Constant BLK_NEXT 2; Constant BLK_PREV 3; [ BlkType txb; return txb-->BLK_HEADER_KOV; ]; [ BlkSize txb bsize n; ! Size of an individual block, including header if (txb == 0) return 0; for (bsize=1: nBLK_HEADER_N: bsize=bsize*2) n++; return bsize; ]; [ BlkTotalSize txb tsize; ! Combined size of multiple-blocks for a value if (txb == 0) return 0; if ((txb->BLK_HEADER_FLAGS) & BLK_FLAG_MULTIPLE == 0) return BlkSize(txb); for (:txb~=NULL:txb=txb-->BLK_NEXT) { tsize = tsize + BlkSize(txb); } return tsize; ]; [ BlkDebug txb n k i bsize tot dtot kov; if (txb == 0) "Block never created."; kov = txb-->BLK_HEADER_KOV; print "Block ", txb, " (kov ", kov, "): "; for (:txb~=NULL:txb = txb-->BLK_NEXT) { if (k++ == 100) " ... and so on."; if (txb-->BLK_HEADER_KOV ~= kov) print "*Wrong kov=", txb-->BLK_HEADER_KOV, "* "; n = txb->BLK_HEADER_N; for (bsize=1:n>0:n--) bsize=bsize*2; i = bsize - BLK_DATA_OFFSET; dtot = dtot+i; tot = tot+bsize; print txb, "(", bsize, ") > "; } print dtot, " data in ", tot, " bytes^"; ]; [ BlkDebugDecomposition from to txb pf; if (to==0) to = NULL; for (txb=from:(txb~=to) && (txb~=NULL):txb=txb-->BLK_NEXT) { if (pf) print "+"; print BlkSize(txb); pf = true; } print "^"; ]; Array Blk_Heap -> MEMORY_HEAP_SIZE + 16; ! Plus 16 to allow room for head-free-block [ HeapInitialise n bsize blk2; blk2 = Blk_Heap + 16; Blk_Heap->BLK_HEADER_N = 4; Blk_Heap-->BLK_HEADER_KOV = 0; Blk_Heap->BLK_HEADER_FLAGS = BLK_FLAG_MULTIPLE; Blk_Heap-->BLK_NEXT = blk2; Blk_Heap-->BLK_PREV = NULL; for (bsize=1: bsize < MEMORY_HEAP_SIZE: bsize=bsize*2) n++; blk2->BLK_HEADER_N = n; blk2-->BLK_HEADER_KOV = 0; blk2->BLK_HEADER_FLAGS = BLK_FLAG_MULTIPLE; blk2-->BLK_NEXT = NULL; blk2-->BLK_PREV = Blk_Heap; ]; [ HeapNetFreeSpace multiple txb asize; for (txb=Blk_Heap-->BLK_NEXT: txb~=NULL: txb=txb-->BLK_NEXT) { asize = asize + BlkSize(txb); if (multiple) asize = asize - BLK_DATA_MULTI_OFFSET; else asize = asize - BLK_DATA_OFFSET; } return asize; ]; Constant SMALLEST_BLK_WORTH_ALLOCATING = 12; ! i.e. 2^12 = 4096 bytes [ HeapMakeSpace size multiple newblocksize newblock B n; for (::) { if (multiple) { if (HeapNetFreeSpace(multiple) >= size) rtrue; } else { if (HeapLargestFreeBlock(0) >= size) rtrue; } newblocksize = 1; for (n=0: (nBLK_HEADER_N = n; newblock-->BLK_HEADER_KOV = 0; newblock->BLK_HEADER_FLAGS = BLK_FLAG_MULTIPLE; newblock-->BLK_NEXT = NULL; newblock-->BLK_PREV = NULL; for (B = Blk_Heap-->BLK_NEXT:B ~= NULL:B = B-->BLK_NEXT) if (B-->BLK_NEXT == NULL) { B-->BLK_NEXT = newblock; newblock-->BLK_PREV = B; jump Linked; } Blk_Heap-->BLK_NEXT = newblock; newblock-->BLK_PREV = Blk_Heap; .Linked; ; #ifdef SHOW_ALLOCATIONS; print "Increasing heap to free space map: "; BlkDebugDecomposition(Blk_Heap, 0); #endif; } rtrue; ]; [ HeapLargestFreeBlock multiple txb asize best; best = 0; for (txb=Blk_Heap-->BLK_NEXT: txb~=NULL: txb=txb-->BLK_NEXT) { asize = BlkSize(txb); if (multiple) asize = asize - BLK_DATA_MULTI_OFFSET; else asize = asize - BLK_DATA_OFFSET; if (asize > best) best = asize; } return best; ]; [ BlkAllocate size kov flags dsize n m free_block min_m max_m smallest_oversized_block secondhalf i hsize head tail; if (HeapMakeSpace(size, flags & BLK_FLAG_MULTIPLE) == false) return BlkAllocationError("ran out"); ! Calculate the header size for a block of this KOV if (flags & BLK_FLAG_MULTIPLE) hsize = BLK_DATA_MULTI_OFFSET; else hsize = BLK_DATA_OFFSET; ! Calculate the data size n=0; for (dsize=1: dsize < hsize+size: dsize=dsize*2) n++; ! Seek a free block closest to the correct size, but starting from the ! block after the fixed head-free-block, which we can't touch min_m = 10000; max_m = 0; for (free_block = Blk_Heap-->BLK_NEXT: free_block ~= NULL: free_block = free_block-->BLK_NEXT) { m = free_block->BLK_HEADER_N; ! Current block the ideal size if (m == n) jump CorrectSizeFound; ! Current block too large: find the smallest which is larger than needed if (m > n) { if (min_m > m) { min_m = m; smallest_oversized_block = free_block; } } ! Current block too small: find the largest which is smaller than needed if (m < n) { if (max_m < m) { max_m = m; } } } if (min_m == 10000) { ! Case I: No block is large enough to hold the entire size if (flags & BLK_FLAG_MULTIPLE == 0) return BlkAllocationError("too fragmented"); ! Set dsize to the size in bytes if the largest block available for (dsize=1: max_m > 0: dsize=dsize*2) max_m--; ! Split as a head (dsize-hsize), which we can be sure fits into one block, ! plus a tail (size-(dsize-hsize), which might be a list of blocks head = BlkAllocate(dsize-hsize, kov, flags); if (head == 0) return BlkAllocationError("head block not available"); tail = BlkAllocate(size-(dsize-hsize), kov, flags); if (tail == 0) return BlkAllocationError("tail block not available"); head-->BLK_NEXT = tail; tail-->BLK_PREV = head; return head; } ! Case II: No block is the right size, but some exist which are too big ! Set dsize to the size in bytes of the smallest oversized block for (dsize=1,m=1: m<=min_m: dsize=dsize*2) m++; free_block = smallest_oversized_block; while (min_m > n) { ! Repeatedly halve free_block at the front until the two smallest ! fragments left are the correct size: then take the frontmost dsize = dsize/2; secondhalf = free_block + dsize; secondhalf-->BLK_NEXT = free_block-->BLK_NEXT; if (secondhalf-->BLK_NEXT ~= NULL) (secondhalf-->BLK_NEXT)-->BLK_PREV = secondhalf; secondhalf-->BLK_PREV = free_block; free_block-->BLK_NEXT = secondhalf; free_block->BLK_HEADER_N = (free_block->BLK_HEADER_N) - 1; secondhalf->BLK_HEADER_N = free_block->BLK_HEADER_N; secondhalf-->BLK_HEADER_KOV = free_block-->BLK_HEADER_KOV; secondhalf->BLK_HEADER_FLAGS = free_block->BLK_HEADER_FLAGS; min_m--; } ! Once that is done, free_block points to a block which is exactly the ! right size, so we can fall into... ! Case III: There is a free block which has the correct size. .CorrectSizeFound; ! Delete the free block from the double linked list of free blocks: note ! that it cannot be the head of this list, which is fixed if (free_block-->BLK_NEXT == NULL) { ! We remove final block, so previous is now final (free_block-->BLK_PREV)-->BLK_NEXT = NULL; } else { ! We remove a middle block, so join previous to next (free_block-->BLK_PREV)-->BLK_NEXT = free_block-->BLK_NEXT; (free_block-->BLK_NEXT)-->BLK_PREV = free_block-->BLK_PREV; } free_block-->BLK_HEADER_KOV = kov; free_block->BLK_HEADER_FLAGS = flags; if (flags & BLK_FLAG_MULTIPLE) { free_block-->BLK_NEXT = NULL; free_block-->BLK_PREV = NULL; } ! Zero out the data bytes in the memory allocated for (i=hsize:ii=0; return free_block; ]; [ BlkAllocationError reason; print "*** Memory ", (string) reason, " ***^"; RunTimeProblem(RTP_HEAPERROR); rfalse; ]; [ BlkMerge block first last pv nx; first = block; last = block; while (last-->BLK_NEXT == last+BlkSize(last)) last = last-->BLK_NEXT; while ((first-->BLK_PREV + BlkSize(first-->BLK_PREV) == first) && (first-->BLK_PREV ~= Blk_Heap)) first = first-->BLK_PREV; pv = first-->BLK_PREV; nx = last-->BLK_NEXT; #ifdef SHOW_ALLOCATIONS; print "Merging: "; BlkDebugDecomposition(pv-->BLK_NEXT, nx); print "^"; #endif; if (BlkRecut(first, last)) { #ifdef SHOW_ALLOCATIONS; print " --> "; BlkDebugDecomposition(pv-->BLK_NEXT, nx); print "^"; #endif; } ]; [ BlkRecut first last tsize backsize mfrom mto bnext backend n dsize fine_so_far; if (first == last) rfalse; mfrom = first; mto = last + BlkSize(last); bnext = last-->BLK_NEXT; fine_so_far = true; for (:mto>mfrom: mto = mto - backsize) { for (n=0, backsize=1: backsize*2 <= mto-mfrom: n++) backsize=backsize*2; if ((fine_so_far) && (backsize == BlkSize(last))) { bnext = last; last = last-->BLK_PREV; bnext-->BLK_PREV = last; last-->BLK_NEXT = bnext; continue; } fine_so_far = false; ! From this point, "last" is meaningless backend = mto - backsize; backend->BLK_HEADER_N = n; backend-->BLK_HEADER_KOV = 0; backend->BLK_HEADER_FLAGS = BLK_FLAG_MULTIPLE; backend-->BLK_NEXT = bnext; if (bnext ~= NULL) { bnext-->BLK_PREV = backend; bnext = backend; } } if (fine_so_far) rfalse; rtrue; ]; [ BlkFree block fromtxb ptxb; if (block == 0) return; BlkValueDestroy(block); if ((block->BLK_HEADER_FLAGS) & BLK_FLAG_MULTIPLE) { if (block-->BLK_PREV ~= NULL) (block-->BLK_PREV)-->BLK_NEXT = NULL; fromtxb = block; for (:(block-->BLK_NEXT)~=NULL:block = block-->BLK_NEXT) ; while (block ~= fromtxb) { ptxb = block-->BLK_PREV; BlkFreeSingleBlock(block); block = ptxb; } } BlkFreeSingleBlock(block); ]; [ BlkFreeSingleBlock block free nx; block-->BLK_HEADER_KOV = 0; block->BLK_HEADER_FLAGS = BLK_FLAG_MULTIPLE; for (free = Blk_Heap:free ~= NULL:free = free-->BLK_NEXT) { nx = free-->BLK_NEXT; if (nx == NULL) { free-->BLK_NEXT = block; block-->BLK_PREV = free; block-->BLK_NEXT = NULL; BlkMerge(block); return; } if (UnsignedCompare(nx, block) == 1) { free-->BLK_NEXT = block; block-->BLK_PREV = free; block-->BLK_NEXT = nx; nx-->BLK_PREV = block; BlkMerge(block); return; } } ]; [ BlkResize block req newsize dsize newblk kov n i otxb flags; if (block == 0) "*** Cannot resize null block ***"; kov = block-->BLK_HEADER_KOV; flags = block->BLK_HEADER_FLAGS; if (flags & BLK_FLAG_MULTIPLE == 0) "*** Cannot resize inextensible block ***"; otxb = block; newsize = req; for (:: block = block-->BLK_NEXT) { n = block->BLK_HEADER_N; for (dsize=1: n>0: n--) dsize = dsize*2; i = dsize - BLK_DATA_MULTI_OFFSET; newsize = newsize - i; if (newsize > 0) { if (block-->BLK_NEXT ~= NULL) continue; newblk = BlkAllocate(newsize, kov, flags); if (newblk == 0) rfalse; block-->BLK_NEXT = newblk; newblk-->BLK_PREV = block; rtrue; } if (block-->BLK_NEXT ~= NULL) { BlkFree(block-->BLK_NEXT); block-->BLK_NEXT = NULL; } rtrue; } ]; [ DebugHeap; print "Managing a heap of initially ", MEMORY_HEAP_SIZE+16, " bytes.^"; print HeapNetFreeSpace(false), " bytes currently free.^"; print "Free space decomposition: "; BlkDebugDecomposition(Blk_Heap); print "Free space map: "; BlkDebug(Blk_Heap); ]; #IFNOT; ! IFDEF MEMORY_HEAP_SIZE [ HeapInitialise; ]; [ BlkFree; ]; [ DebugHeap; "This story file does not use a heap of managed memory."; ]; #ENDIF; ! IFDEF MEMORY_HEAP_SIZE #IFDEF MEMORY_HEAP_SIZE; [ BlkValueExtent block tsize flags; if (block == 0) return 0; flags = block->BLK_HEADER_FLAGS; if (flags & BLK_FLAG_MULTIPLE == 0) tsize = BlkSize(block) - BLK_DATA_OFFSET; else for (:block~=NULL:block=block-->BLK_NEXT) tsize = tsize + BlkSize(block) - BLK_DATA_MULTI_OFFSET; if (flags & BLK_FLAG_16_BIT) return tsize/2; if (flags & BLK_FLAG_WORD) return tsize/WORDSIZE; return tsize; ]; [ BlkValueSetExtent block tsize flags wsize; if (block == 0) return 0; flags = block->BLK_HEADER_FLAGS; wsize = 1; if (flags & BLK_FLAG_WORD) wsize = WORDSIZE; if (flags & BLK_FLAG_16_BIT) wsize = 2; return BlkResize(block, (tsize)*wsize); ]; [ BlkValueRead block pos dsize hsize flags wsize ot op; if (block==0) rfalse; flags = block->BLK_HEADER_FLAGS; wsize = 1; if (flags & BLK_FLAG_WORD) wsize = WORDSIZE; if (flags & BLK_FLAG_16_BIT) wsize = 2; ot = block; op = pos; pos = pos*wsize; if (flags & BLK_FLAG_MULTIPLE) hsize = BLK_DATA_MULTI_OFFSET; else hsize = BLK_DATA_OFFSET; for (:block~=NULL:block=block-->BLK_NEXT) { dsize = BlkSize(block) - hsize; if ((pos >= 0) && (pos0; 2: #Iftrue (WORDSIZE == 2); return block-->0; #ifnot; return (block->0)*256 + (block->1); #endif; 4: return block-->0; } } pos = pos - dsize; } "*** BlkValueRead: reading from index out of range: ", op, " in ", ot, " ***"; ]; [ BlkValueWrite block pos val dsize hsize flags wsize ot op; if (block==0) rfalse; flags = block->BLK_HEADER_FLAGS; wsize = 1; if (flags & BLK_FLAG_WORD) wsize = WORDSIZE; if (flags & BLK_FLAG_16_BIT) wsize = 2; ot = block; op = pos; pos = pos*wsize; if (flags & BLK_FLAG_MULTIPLE) hsize = BLK_DATA_MULTI_OFFSET; else hsize = BLK_DATA_OFFSET; for (:block~=NULL:block=block-->BLK_NEXT) { dsize = BlkSize(block) - hsize; if ((pos >= 0) && (pos0 = val; 2: #Iftrue (WORDSIZE == 2); block-->0 = val; #ifnot; block->0 = (val/256)%256; block->1 = val%256; #endif; 4: block-->0 = val; } return; } pos = pos - dsize; } "*** BlkValueWrite: writing to index out of range: ", op, " in ", ot, " ***"; ]; Constant CREATE_KOVS = 1; Constant CAST_KOVS = 2; Constant DESTROY_KOVS = 3; Constant PRECOPY_KOVS = 4; Constant COPY_KOVS = 5; Constant COMPARE_KOVS = 6; Constant READ_FILE_KOVS = 7; Constant WRITE_FILE_KOVS = 8; Global block_value_tally; [ BlkValueCreate kov cast_from skov block sf; sf = KOVSupportFunction(kov); if (sf) block = sf(CREATE_KOVS, cast_from, skov); else { print "*** Impossible runtime creation ***^"; rfalse; } #ifdef SHOW_ALLOCATIONS; print "[created ", kov, " at ", block, ": ", block_value_tally++, "]^"; #endif; return block; ]; [ BlkValueCast block tokov fromkov fromval sf; sf = KOVSupportFunction(tokov); if (sf) return sf(CAST_KOVS, fromval, fromkov, block); else { print "*** Impossible runtime cast ***^"; rfalse; } ]; [ BlkValueDestroy block k rv sf; if (block == 0) return; k = block-->BLK_HEADER_KOV; sf = KOVSupportFunction(k); if (sf) return sf(DESTROY_KOVS, block); else { print "*** Impossible runtime deallocation ***^"; rfalse; } ]; [ BlkValueCopy blockto blockfrom dsize i sf; if (blockto == 0) { print "*** Deep copy failed: destination empty ***^"; rfalse; } if (blockfrom == 0) { print "*** Deep copy failed: source empty ***^"; rfalse; } if (blockfrom->BLK_HEADER_N == 0) { ! A hack to handle precompiled array constants: N=0 blocks otherwise don't exist LIST_OF_TY_CopyRawArray(blockto, blockfrom, 1); return blockto; } if (blockfrom-->BLK_HEADER_KOV ~= blockto-->BLK_HEADER_KOV) { print "*** Deep copy failed: types mismatch ***^"; rfalse; } BlkValueDestroy(blockto); dsize = BlkValueExtent(blockfrom); if (((blockfrom->BLK_HEADER_FLAGS) & BLK_FLAG_MULTIPLE) && (BlkValueSetExtent(blockto, dsize, -1) == false)) { print "*** Deep copy failed: resizing failed ***^"; rfalse; } sf = KOVSupportFunction(blockfrom-->BLK_HEADER_KOV); if (sf) sf(PRECOPY_KOVS, blockto, blockfrom); for (i=0:iBLK_HEADER_KOV ~= blockright-->BLK_HEADER_KOV) return blockleft-->BLK_HEADER_KOV - blockright-->BLK_HEADER_KOV; kov = blockleft-->BLK_HEADER_KOV; sf = KOVSupportFunction(kov); if (sf) return sf(COMPARE_KOVS, blockleft, blockright); else { print "*** Impossible runtime comparison ***^"; rfalse; } ]; [ BlkValueInitialCopy blockto blockfrom dsize i; if (blockto == 0) { print "*** Initial copy failed: destination empty ***^"; rfalse; } if (blockfrom == 0) { print "*** Initial copy failed: source empty ***^"; rfalse; } dsize = 1; for (i=1: i<=blockfrom->BLK_HEADER_N: i++) dsize=dsize*2; for (i=0:ii = blockfrom->i; return blockto; ]; [ BlkValueReadFromFile block auxf ch kov sf; sf = KOVSupportFunction(kov); if (sf) return sf(READ_FILE_KOVS, block, auxf, ch); rfalse; ]; [ BlkValueWriteToFile block kov sf; sf = KOVSupportFunction(kov); if (sf) return sf(WRITE_FILE_KOVS, block); rfalse; ]; #IFNOT; ! IFDEF MEMORY_HEAP_SIZE [ BlkValueReadFromFile; rfalse; ]; [ BlkValueWriteToFile; rfalse; ]; [ BlkValueCreate; ]; [ BlkValueCompare x y; ]; #ENDIF; ! IFDEF MEMORY_HEAP_SIZE #IFDEF MEMORY_HEAP_SIZE; ! Will exist if any use is made of indexed texts #IFDEF TARGET_ZCODE; Constant IT_Storage_Flags = BLK_FLAG_MULTIPLE; Constant ZSCII_Tables; #IFNOT; Constant IT_Storage_Flags = BLK_FLAG_MULTIPLE + BLK_FLAG_16_BIT; Constant Large_Unicode_Tables; #ENDIF; Constant UNIC_NCT = 10000; ! Safe as highest case-change delta is 8383 #IFDEF ZSCII_Tables; Array CharCasingChart0 --> $0061 ( 26) ( -32) $009b ( 3) ( 3) $00a1 ( 1) (UNIC_NCT) $00a4 ( 2) ( 3) $00a6 ( 1) (UNIC_NCT) $00a9 ( 6) ( 6) $00b5 ( 5) ( 5) $00bf ( 5) ( 5) $00c9 ( -3) ( 1) $00cd ( 3) ( 3) $00d3 ( -3) ( 1) $00d7 ( 2) ( 2) $00dc ( 1) ( 1) $0000 ; Array CharCasingChart1 --> $0041 ( 26) ( 32) $009e ( 3) ( -3) $00a7 ( 2) ( -3) $00af ( 6) ( -6) $00ba ( 5) ( -5) $00c4 ( 5) ( -5) $00ca ( -3) ( -1) $00d0 ( 3) ( -3) $00d4 ( -3) ( -1) $00d9 ( 2) ( -2) $00dd ( 1) ( -1) $0000 ; #ENDIF; ! ZSCII_Tables #IFDEF Small_Unicode_Tables; Array CharCasingChart0 --> $0061 ( 26) ( -32) $00aa ( 1) (UNIC_NCT) $00b5 ( 1) (UNIC_NCT) $00ba ( 1) (UNIC_NCT) $00df ( 1) (UNIC_NCT) $00e0 ( 23) ( -32) $00f8 ( 7) ( -32) $00ff ( 1) (UNIC_NCT) $0000 ; Array CharCasingChart1 --> $0041 ( 26) ( 32) $00c0 ( 23) ( 32) $00d8 ( 7) ( 32) $0000 ; #ENDIF; ! Small_Unicode_Tables #IFDEF Large_Unicode_Tables; Array CharCasingChart0 --> $0061 ( 26) ( -32) $00aa ( 1) (UNIC_NCT) $00b5 ( 1) ( 743) $00ba ( 1) (UNIC_NCT) $00df ( 1) (UNIC_NCT) $00e0 ( 23) ( -32) $00f8 ( 7) ( -32) $00ff ( 1) ( 121) $0101 ( -47) ( -1) $0131 ( 1) ( -232) $0133 ( -5) ( -1) $0138 ( 1) (UNIC_NCT) $013a ( -15) ( -1) $0149 ( 1) (UNIC_NCT) $014b ( -45) ( -1) $017a ( -5) ( -1) $017f ( 1) ( -300) $0180 ( 1) (UNIC_NCT) $0183 ( -3) ( -1) $0188 ( 1) ( -1) $018c ( 1) ( -1) $018d ( 1) (UNIC_NCT) $0192 ( 1) ( -1) $0195 ( 1) ( 97) $0199 ( 1) ( -1) $019a ( 2) (UNIC_NCT) $019e ( 1) ( 130) $01a1 ( -5) ( -1) $01a8 ( 1) ( -1) $01aa ( 2) (UNIC_NCT) $01ad ( 1) ( -1) $01b0 ( 1) ( -1) $01b4 ( -3) ( -1) $01b9 ( 1) ( -1) $01ba ( 1) (UNIC_NCT) $01bd ( 1) ( -1) $01be ( 1) (UNIC_NCT) $01bf ( 1) ( 56) $01c6 ( 1) ( -2) $01c9 ( 1) ( -2) $01cc ( 1) ( -2) $01ce ( -15) ( -1) $01dd ( 1) ( -79) $01df ( -17) ( -1) $01f0 ( 1) (UNIC_NCT) $01f3 ( 1) ( -2) $01f5 ( 1) ( -1) $01f9 ( -39) ( -1) $0221 ( 1) (UNIC_NCT) $0223 ( -17) ( -1) $0234 ( 3) (UNIC_NCT) $0250 ( 3) (UNIC_NCT) $0253 ( 1) ( -210) $0254 ( 1) ( -206) $0255 ( 1) (UNIC_NCT) $0256 ( 2) ( -205) $0258 ( 1) (UNIC_NCT) $0259 ( 1) ( -202) $025a ( 1) (UNIC_NCT) $025b ( 1) ( -203) $025c ( 4) (UNIC_NCT) $0260 ( 1) ( -205) $0261 ( 2) (UNIC_NCT) $0263 ( 1) ( -207) $0264 ( 4) (UNIC_NCT) $0268 ( 1) ( -209) $0269 ( 1) ( -211) $026a ( 5) (UNIC_NCT) $026f ( 1) ( -211) $0270 ( 2) (UNIC_NCT) $0272 ( 1) ( -213) $0273 ( 2) (UNIC_NCT) $0275 ( 1) ( -214) $0276 ( 10) (UNIC_NCT) $0280 ( 1) ( -218) $0281 ( 2) (UNIC_NCT) $0283 ( 1) ( -218) $0284 ( 4) (UNIC_NCT) $0288 ( 1) ( -218) $0289 ( 1) (UNIC_NCT) $028a ( 2) ( -217) $028c ( 6) (UNIC_NCT) $0292 ( 1) ( -219) $0293 ( 29) (UNIC_NCT) $0390 ( 1) (UNIC_NCT) $03ac ( 1) ( -38) $03ad ( 3) ( -37) $03b0 ( 1) (UNIC_NCT) $03b1 ( 17) ( -32) $03c2 ( 1) ( -31) $03c3 ( 9) ( -32) $03cc ( 1) ( -64) $03cd ( 2) ( -63) $03d0 ( 1) ( -62) $03d1 ( 1) ( -57) $03d5 ( 1) ( -47) $03d6 ( 1) ( -54) $03d7 ( 1) (UNIC_NCT) $03d9 ( -23) ( -1) $03f0 ( 1) ( -86) $03f1 ( 1) ( -80) $03f2 ( 1) ( 7) $03f3 ( 1) (UNIC_NCT) $03f5 ( 1) ( -96) $03f8 ( 1) ( -1) $03fb ( 1) ( -1) $0430 ( 32) ( -32) $0450 ( 16) ( -80) $0461 ( -33) ( -1) $048b ( -53) ( -1) $04c2 ( -13) ( -1) $04d1 ( -37) ( -1) $04f9 ( 1) ( -1) $0501 ( -15) ( -1) $0561 ( 38) ( -48) $0587 ( 1) (UNIC_NCT) $1d00 ( 44) (UNIC_NCT) $1d62 ( 10) (UNIC_NCT) $1e01 (-149) ( -1) $1e96 ( 5) (UNIC_NCT) $1e9b ( 1) ( -59) $1ea1 ( -89) ( -1) $1f00 ( 8) ( 8) $1f10 ( 6) ( 8) $1f20 ( 8) ( 8) $1f30 ( 8) ( 8) $1f40 ( 6) ( 8) $1f50 ( 1) (UNIC_NCT) $1f51 ( 1) ( 8) $1f52 ( 1) (UNIC_NCT) $1f53 ( 1) ( 8) $1f54 ( 1) (UNIC_NCT) $1f55 ( 1) ( 8) $1f56 ( 1) (UNIC_NCT) $1f57 ( 1) ( 8) $1f60 ( 8) ( 8) $1f70 ( 2) ( 74) $1f72 ( 4) ( 86) $1f76 ( 2) ( 100) $1f78 ( 2) ( 128) $1f7a ( 2) ( 112) $1f7c ( 2) ( 126) $1f80 ( 8) ( 8) $1f90 ( 8) ( 8) $1fa0 ( 8) ( 8) $1fb0 ( 2) ( 8) $1fb2 ( 1) (UNIC_NCT) $1fb3 ( 1) ( 9) $1fb4 ( -3) (UNIC_NCT) $1fb7 ( 1) (UNIC_NCT) $1fbe ( 1) ( -7205) $1fc2 ( 1) (UNIC_NCT) $1fc3 ( 1) ( 9) $1fc4 ( -3) (UNIC_NCT) $1fc7 ( 1) (UNIC_NCT) $1fd0 ( 2) ( 8) $1fd2 ( 2) (UNIC_NCT) $1fd6 ( 2) (UNIC_NCT) $1fe0 ( 2) ( 8) $1fe2 ( 3) (UNIC_NCT) $1fe5 ( 1) ( 7) $1fe6 ( 2) (UNIC_NCT) $1ff2 ( 1) (UNIC_NCT) $1ff3 ( 1) ( 9) $1ff4 ( -3) (UNIC_NCT) $1ff7 ( 1) (UNIC_NCT) $2071 ( 1) (UNIC_NCT) $207f ( 1) (UNIC_NCT) $210a ( 1) (UNIC_NCT) $210e ( 2) (UNIC_NCT) $2113 ( 1) (UNIC_NCT) $212f ( 1) (UNIC_NCT) $2134 ( 1) (UNIC_NCT) $2139 ( 1) (UNIC_NCT) $213d ( 1) (UNIC_NCT) $2146 ( 4) (UNIC_NCT) $fb00 ( 7) (UNIC_NCT) $fb13 ( 5) (UNIC_NCT) $ff41 ( 26) ( -32) $0000 ; Array CharCasingChart1 --> $0041 ( 26) ( 32) $00c0 ( 23) ( 32) $00d8 ( 7) ( 32) $0100 ( -47) ( 1) $0130 ( 1) ( -199) $0132 ( -5) ( 1) $0139 ( -15) ( 1) $014a ( -45) ( 1) $0178 ( 1) ( -121) $0179 ( -5) ( 1) $0181 ( 1) ( 210) $0182 ( -3) ( 1) $0186 ( 1) ( 206) $0187 ( 1) ( 1) $0189 ( 2) ( 205) $018b ( 1) ( 1) $018e ( 1) ( 79) $018f ( 1) ( 202) $0190 ( 1) ( 203) $0191 ( 1) ( 1) $0193 ( 1) ( 205) $0194 ( 1) ( 207) $0196 ( 1) ( 211) $0197 ( 1) ( 209) $0198 ( 1) ( 1) $019c ( 1) ( 211) $019d ( 1) ( 213) $019f ( 1) ( 214) $01a0 ( -5) ( 1) $01a6 ( 1) ( 218) $01a7 ( 1) ( 1) $01a9 ( 1) ( 218) $01ac ( 1) ( 1) $01ae ( 1) ( 218) $01af ( 1) ( 1) $01b1 ( 2) ( 217) $01b3 ( -3) ( 1) $01b7 ( 1) ( 219) $01b8 ( 1) ( 1) $01bc ( 1) ( 1) $01c4 ( 1) ( 2) $01c7 ( 1) ( 2) $01ca ( 1) ( 2) $01cd ( -15) ( 1) $01de ( -17) ( 1) $01f1 ( 1) ( 2) $01f4 ( 1) ( 1) $01f6 ( 1) ( -97) $01f7 ( 1) ( -56) $01f8 ( -39) ( 1) $0220 ( 1) ( -130) $0222 ( -17) ( 1) $0386 ( 1) ( 38) $0388 ( 3) ( 37) $038c ( 1) ( 64) $038e ( 2) ( 63) $0391 ( 17) ( 32) $03a3 ( 9) ( 32) $03d2 ( 3) (UNIC_NCT) $03d8 ( -23) ( 1) $03f4 ( 1) ( -60) $03f7 ( 1) ( 1) $03f9 ( 1) ( -7) $03fa ( 1) ( 1) $0400 ( 16) ( 80) $0410 ( 32) ( 32) $0460 ( -33) ( 1) $048a ( -53) ( 1) $04c0 ( 1) (UNIC_NCT) $04c1 ( -13) ( 1) $04d0 ( -37) ( 1) $04f8 ( 1) ( 1) $0500 ( -15) ( 1) $0531 ( 38) ( 48) $10a0 ( 38) (UNIC_NCT) $1e00 (-149) ( 1) $1ea0 ( -89) ( 1) $1f08 ( 8) ( -8) $1f18 ( 6) ( -8) $1f28 ( 8) ( -8) $1f38 ( 8) ( -8) $1f48 ( 6) ( -8) $1f59 ( -7) ( -8) $1f68 ( 8) ( -8) $1fb8 ( 2) ( -8) $1fba ( 2) ( -74) $1fc8 ( 4) ( -86) $1fd8 ( 2) ( -8) $1fda ( 2) ( -100) $1fe8 ( 2) ( -8) $1fea ( 2) ( -112) $1fec ( 1) ( -7) $1ff8 ( 2) ( -128) $1ffa ( 2) ( -126) $2102 ( 1) (UNIC_NCT) $2107 ( 1) (UNIC_NCT) $210b ( 3) (UNIC_NCT) $2110 ( 3) (UNIC_NCT) $2115 ( 1) (UNIC_NCT) $2119 ( 5) (UNIC_NCT) $2124 ( 1) (UNIC_NCT) $2126 ( 1) ( -7517) $2128 ( 1) (UNIC_NCT) $212a ( 1) ( -8383) $212b ( 1) ( -8262) $212c ( 2) (UNIC_NCT) $2130 ( 2) (UNIC_NCT) $2133 ( 1) (UNIC_NCT) $213e ( 2) (UNIC_NCT) $2145 ( 1) (UNIC_NCT) $ff21 ( 26) ( 32) $0000 ; #ENDIF; ! Large_Unicode_Tables [ CharIsOfCase c case i tab min max len par; if (c<'A') rfalse; if (case == 0) { if ((c >= 'a') && (c <= 'z')) rtrue; tab = CharCasingChart0; } else { if ((c >= 'A') && (c <= 'Z')) rtrue; tab = CharCasingChart1; } if (c<128) rfalse; while (tab-->i) { min = tab-->i; i++; len = tab-->i; i++; i++; par = 0; if (len<0) { par = 1; len = -len; } if (c < min) rfalse; if (c < min+len) { if (par) { if ((c-min) % 2 == 0) rtrue; } else { rtrue; } } } rfalse; ]; [ CharToCase c case i tab min max len par del f; if (c<'A') return c; if (case == 1) { if ((c >= 'a') && (c <= 'z')) return c-32; tab = CharCasingChart0; } else { if ((c >= 'A') && (c <= 'Z')) return c+32; tab = CharCasingChart1; } if (c<128) return c; while (tab-->i) { min = tab-->i; i++; len = tab-->i; i++; del = tab-->i; i++; par = 0; if (len<0) { par = 1; len = -len; } if (c < min) return c; if (c < min+len) { f = false; if (par) { if ((c-min) % 2 == 0) f = true; } else { f = true; } if (f) { if (del == UNIC_NCT) return c; return c+del; } } } return c; ]; #IFDEF TARGET_ZCODE; [ IT_RevCase ch; if (ch<'A') return ch; if ((ch >= 'a') && (ch <= 'z')) return ch-'a'+'A'; if ((ch >= 'A') && (ch <= 'Z')) return ch-'A'+'a'; if (ch<128) return ch; if ((ch >= 155) && (ch <= 157)) return ch+3; ! a, o, u umlaut in ZSCII if ((ch >= 158) && (ch <= 160)) return ch-3; ! A, O, U umlaut if ((ch >= 164) && (ch <= 165)) return ch+3; ! e, i umlaut if ((ch >= 167) && (ch <= 168)) return ch-3; ! E, I umlaut if ((ch >= 169) && (ch <= 174)) return ch+6; ! a, e, i, o, u, y acute if ((ch >= 175) && (ch <= 180)) return ch-6; ! A, E, I, O, U, Y acute if ((ch >= 181) && (ch <= 185)) return ch+5; ! a, e, i, o, u grave if ((ch >= 186) && (ch <= 190)) return ch-5; ! A, E, I, O, U grave if ((ch >= 191) && (ch <= 195)) return ch+5; ! a, e, i, o, u circumflex if ((ch >= 196) && (ch <= 200)) return ch-5; ! A, E, I, O, U circumflex if (ch == 201) return 202; ! a circle if (ch == 202) return 201; ! A circle if (ch == 203) return 204; ! o slash if (ch == 204) return 203; ! O slash if ((ch >= 205) && (ch <= 207)) return ch+3; ! a, n, o tilde if ((ch >= 208) && (ch <= 210)) return ch-3; ! A, N, O tilde if (ch == 211) return 212; ! ae ligature if (ch == 212) return 211; ! AE ligature if (ch == 213) return 214; ! c cedilla if (ch == 214) return 213; ! C cedilla if (ch == 215 or 216) return ch+2; ! thorn, eth if (ch == 217 or 218) return ch-2; ! Thorn, Eth if (ch == 220) return 221; ! oe ligature if (ch == 221) return 220; ! OE ligature return ch; ]; #IFNOT; [ IT_RevCase ch; if (ch<'A') return ch; if ((ch >= 'a') && (ch <= 'z')) return ch-'a'+'A'; if ((ch >= 'A') && (ch <= 'Z')) return ch-'A'+'a'; if (ch<128) return ch; if (CharIsOfCase(ch, 0)) return CharToCase(ch, 1); if (CharIsOfCase(ch, 1)) return CharToCase(ch, 0); return ch; ]; #ENDIF; [ CharTestCases case i j; for (i=32: i<$E0; i++) { if ((i>=127) && (i<155)) continue; print i, " - ", (char) i, " -"; if (CharIsOfCase(i, 0)) print " lower"; if (CharIsOfCase(i, 1)) print " upper"; j = CharToCase(i, 0); if (j ~= i) print " tolower: ", (char) j; j = CharToCase(i, 1); if (j ~= i) print " toupper: ", (char) j; print "^"; } ]; [ INDEXED_TEXT_TY_Support task arg1 arg2 arg3; switch(task) { CREATE_KOVS: return INDEXED_TEXT_TY_Create(arg1); CAST_KOVS: return INDEXED_TEXT_TY_Cast(arg1, arg2, arg3); DESTROY_KOVS: rfalse; PRECOPY_KOVS: rfalse; COPY_KOVS: rfalse; COMPARE_KOVS: return INDEXED_TEXT_TY_Compare(arg1, arg2); READ_FILE_KOVS: if (arg3 == -1) rtrue; return INDEXED_TEXT_TY_ReadFile(arg1, arg2, arg3); WRITE_FILE_KOVS: return INDEXED_TEXT_TY_WriteFile(arg1); } ]; [ INDEXED_TEXT_TY_Create opcast x; x = BlkAllocate(32, INDEXED_TEXT_TY, IT_Storage_Flags); if (opcast) INDEXED_TEXT_TY_Cast(opcast, TEXT_TY, x); return x; ]; #ifndef IT_MemoryBufferSize; Constant IT_MemoryBufferSize = 512; #endif; Constant IT_Memory_NoBuffers = 2; #ifndef IT_Memory_NoBuffers; Constant IT_Memory_NoBuffers = 1; #endif; #ifdef TARGET_ZCODE; Array IT_MemoryBuffer -> IT_MemoryBufferSize*IT_Memory_NoBuffers; ! Where characters are bytes #ifnot; Array IT_MemoryBuffer --> (IT_MemoryBufferSize+2)*IT_Memory_NoBuffers; ! Where characters are words #endif; Global RawBufferAddress = IT_MemoryBuffer; Global RawBufferSize = IT_MemoryBufferSize; Global IT_cast_nesting; [ INDEXED_TEXT_TY_Cast tx fromkov indt len i str oldstr offs realloc news buff buffx freebuff results; #ifdef TARGET_ZCODE; buffx = IT_MemoryBufferSize; #ifnot; buffx = (IT_MemoryBufferSize + 2)*WORDSIZE; #endif; buff = RawBufferAddress + IT_cast_nesting*buffx; IT_cast_nesting++; if (IT_cast_nesting > IT_Memory_NoBuffers) { buff = VM_AllocateMemory(buffx); freebuff = buff; if (buff == 0) { BlkAllocationError("ran out with too many simultaneous indexed text conversions"); return; } } .RetryWithLargerBuffer; if (tx == 0) { #ifdef TARGET_ZCODE; buff-->0 = 1; buff->2 = 0; #ifnot; buff-->0 = 0; #endif; len = 1; } else { #ifdef TARGET_ZCODE; @output_stream 3 buff; #ifnot; if (unicode_gestalt_ok == false) { RunTimeProblem(RTP_NOGLULXUNICODE); jump Failed; } oldstr = glk_stream_get_current(); str = glk_stream_open_memory_uni(buff, RawBufferSize, filemode_Write, 0); glk_stream_set_current(str); #endif; @push say__p; @push say__pc; ClearParagraphing(); if (fromkov == SNIPPET_TY) print (PrintSnippet) tx; else { if (tx ofclass String) print (string) tx; if (tx ofclass Routine) (tx)(); } @pull say__pc; @pull say__p; #ifdef TARGET_ZCODE; @output_stream -3; len = buff-->0; if (len > RawBufferSize-1) len = RawBufferSize-1; offs = 2; buff->(len+2) = 0; #ifnot; ! i.e. GLULX results = buff + buffx - 2*WORDSIZE; glk_stream_close(str, results); if (oldstr) glk_stream_set_current(oldstr); len = results-->1; if (len > RawBufferSize-1) { ! Glulx had to truncate text output because the buffer ran out: ! len is the number of characters which it tried to print news = RawBufferSize; while (news < len) news=news*2; news = news*4; ! Bytes rather than words i = VM_AllocateMemory(news); if (i ~= 0) { if (freebuff) VM_FreeMemory(freebuff); freebuff = i; buff = i; RawBufferSize = news/4; jump RetryWithLargerBuffer; } ! Memory allocation refused: all we can do is to truncate the text len = RawBufferSize-1; } offs = 0; buff-->(len) = 0; #endif; len++; } IT_cast_nesting--; if (indt == 0) { indt = BlkAllocate(len+1, INDEXED_TEXT_TY, IT_Storage_Flags); if (indt == 0) jump Failed; } else { if (BlkValueSetExtent(indt, len+1, 1) == false) { indt = 0; jump Failed; } } #ifdef TARGET_ZCODE; for (i=0:i<=len:i++) BlkValueWrite(indt, i, buff->(i+offs)); #ifnot; for (i=0:i<=len:i++) BlkValueWrite(indt, i, buff-->(i+offs)); #endif; .Failed; if (freebuff) VM_FreeMemory(freebuff); return indt; ]; [ INDEXED_TEXT_TY_Compare indtleft indtright pos ch1 ch2 dsizeleft dsizeright; dsizeleft = BlkValueExtent(indtleft); dsizeright = BlkValueExtent(indtright); for (pos=0:(pos= tsize) { if (BlkValueSetExtent(indt, 2*pos, 20) == false) break; tsize = BlkValueExtent(indt); } BlkValueWrite(indt, pos++, v); v = 0; if (ch == ';') break; } else { dg = ch - '0'; v = v*10 + dg; } } BlkValueWrite(indt, pos, 0); return indt; ]; [ INDEXED_TEXT_TY_ROGPR indt pos len wa wl wpos bdm ch own; if (indt == 0) return GPR_FAIL; bdm = true; own = wn; len = BlkValueExtent(indt); for (pos=0: pos<=len: pos++) { if (pos == len) ch = 0; else ch = BlkValueRead(indt, pos); if (ch == 32 or 9 or 10 or 0) { if (bdm) continue; bdm = true; if (wpos ~= wl) return GPR_FAIL; if (ch == 0) break; } else { if (bdm) { bdm = false; if (NextWordStopped() == -1) return GPR_FAIL; wa = WordAddress(wn-1); wl = WordLength(wn-1); wpos = 0; } if (wa->wpos ~= ch or IT_RevCase(ch)) return GPR_FAIL; wpos++; } } if (wn == own) return GPR_FAIL; ! Progress must be made to avoid looping return GPR_PREPOSITION; ]; Constant CHR_BLOB = 1; ! Construe as an array of characters Constant WORD_BLOB = 2; ! Of words Constant PWORD_BLOB = 3; ! Of punctuated words Constant UWORD_BLOB = 4; ! Of unpunctuated words Constant PARA_BLOB = 5; ! Of paragraphs Constant LINE_BLOB = 6; ! Of lines Constant REGEXP_BLOB = 7; ! Not a blob type as such, but needed as a distinct value Constant WS_BRM = 1; Constant SKIPPED_BRM = 2; Constant ACCEPTED_BRM = 3; Constant ACCEPTEDP_BRM = 4; Constant ACCEPTEDN_BRM = 5; Constant ACCEPTEDPN_BRM = 6; [ IT_BlobAccess indt blobtype cindt wanted rindt brm oldbrm ch i dsize csize blobcount gp cl j; if ((indt==0) || (BlkType(indt) ~= INDEXED_TEXT_TY)) return 0; if (blobtype == CHR_BLOB) return IT_CharacterLength(indt); dsize = BlkValueExtent(indt); if (cindt) csize = BlkValueExtent(cindt); else if (rindt) "*** rindt without cindt ***"; brm = WS_BRM; for (i=0:i= 2) brm = WS_BRM; LINE_BLOB: if (gp >= 1) brm = WS_BRM; default: brm = WS_BRM; } } } else { gp = false; if ((blobtype == WORD_BLOB or PWORD_BLOB or UWORD_BLOB) && (ch == '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}')) gp = true; switch (oldbrm) { WS_BRM: brm = ACCEPTED_BRM; if (blobtype == WORD_BLOB) { if (gp) brm = SKIPPED_BRM; } if (blobtype == PWORD_BLOB) { if (gp) brm = ACCEPTEDP_BRM; } SKIPPED_BRM: if (blobtype == WORD_BLOB) { if (gp == false) brm = ACCEPTED_BRM; } ACCEPTED_BRM: if (blobtype == WORD_BLOB) { if (gp) brm = SKIPPED_BRM; } if (blobtype == PWORD_BLOB) { if (gp) brm = ACCEPTEDP_BRM; } ACCEPTEDP_BRM: if (blobtype == PWORD_BLOB) { if (gp == false) brm = ACCEPTED_BRM; else { if ((ch == BlkValueRead(indt, i-1)) && (ch == '-' or '.')) blobcount--; blobcount++; } } ACCEPTEDN_BRM: if (blobtype == WORD_BLOB) { if (gp) brm = SKIPPED_BRM; } if (blobtype == PWORD_BLOB) { if (gp) brm = ACCEPTEDP_BRM; } ACCEPTEDPN_BRM: if (blobtype == PWORD_BLOB) { if (gp == false) brm = ACCEPTED_BRM; else { if ((ch == BlkValueRead(indt, i-1)) && (ch == '-' or '.')) blobcount--; blobcount++; } } } } if (brm == ACCEPTED_BRM or ACCEPTEDP_BRM) { if (oldbrm ~= brm) blobcount++; if ((cindt) && (blobcount == wanted)) { if (rindt) { BlkValueWrite(cindt, cl, 0); IT_Concatenate(cindt, rindt, CHR_BLOB); csize = BlkValueExtent(cindt); cl = IT_CharacterLength(cindt); if (brm == ACCEPTED_BRM) brm = ACCEPTEDN_BRM; if (brm == ACCEPTEDP_BRM) brm = ACCEPTEDPN_BRM; } else { if (cl+1 >= csize) { if (BlkValueSetExtent(cindt, 2*cl, 2) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } } else { if (rindt) { if (cl+1 >= csize) { if (BlkValueSetExtent(cindt, 2*cl, 3) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } } } else { if ((rindt) && (brm ~= ACCEPTEDN_BRM or ACCEPTEDPN_BRM)) { if (cl+1 >= csize) { if (BlkValueSetExtent(cindt, 2*cl, 4) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } } } if (cindt) BlkValueWrite(cindt, cl++, 0); return blobcount; ]; [ IT_GetBlob cindt indt wanted blobtype; if ((indt==0) || (BlkType(indt) ~= INDEXED_TEXT_TY)) return; if (blobtype == CHR_BLOB) return IT_GetCharacter(cindt, indt, wanted); IT_BlobAccess(indt, blobtype, cindt, wanted); return cindt; ]; [ IT_ReplaceBlob blobtype indt wanted rindt cindt ilen rlen i; if (blobtype == CHR_BLOB) { ilen = IT_CharacterLength(indt); rlen = IT_CharacterLength(rindt); wanted--; if ((wanted >= 0) && (wanted= csize) { if (BlkValueSetExtent(cindt, 2*cl, 9) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } BlkValueCopy(indt, cindt); BlkFree(cindt); ]; [ IT_CharacterLength indt ch i dsize; if ((indt==0) || (BlkType(indt) ~= INDEXED_TEXT_TY)) return 0; dsize = BlkValueExtent(indt); for (i=0:iIT_CharacterLength(indt))) ch = 0; else ch = BlkValueRead(indt, i-1); BlkValueWrite(cindt, 0, ch); BlkValueWrite(cindt, 1, 0); return cindt; ]; [ IT_CharactersOfCase indt case i ch len; if ((indt==0) || (BlkType(indt) ~= INDEXED_TEXT_TY)) rfalse; len = IT_CharacterLength(indt); for (i=0:i 118) len = 118; #ifdef TARGET_ZCODE; buffer->1 = len; at = 2; #ifnot; buffer-->0 = len; at = 4; #endif; for (i=0:i(i+at) = CharToCase(BlkValueRead(indt_from, i), 0); for (:at+i<120:i++) buffer->(at+i) = ' '; VM_Tokenise(buffer, parse); players_command = 100 + WordCount(); ! The snippet variable ``player's command'' ]; #IFNOT; ! IFDEF MEMORY_HEAP_SIZE [ INDEXED_TEXT_TY_Support t a b c; rfalse; ]; [ INDEXED_TEXT_TY_Say indt; ]; [ SetPlayersCommand indt_from; ]; [ INDEXED_TEXT_TY_Create; ]; [ INDEXED_TEXT_TY_Cast a b c; ]; [ INDEXED_TEXT_TY_Empty t; rfalse; ]; #ENDIF; ! IFDEF MEMORY_HEAP_SIZE #IFDEF MEMORY_HEAP_SIZE; ! Will exist if any use is made of indexed texts Global IT_RE_Trace = false; ! Change to true for (a lot of) debugging data in use [ IT_RE_SetTrace F; IT_RE_Trace = F; ]; ! Character classes Constant NEWLINE_RE_CC = -1; Constant TAB_RE_CC = -2; Constant DIGIT_RE_CC = -3; Constant NONDIGIT_RE_CC = -4; Constant WHITESPACE_RE_CC = -5; Constant NONWHITESPACE_RE_CC = -6; Constant PUNCTUATION_RE_CC = -7; Constant NONPUNCTUATION_RE_CC = -8; Constant WORD_RE_CC = -9; Constant NONWORD_RE_CC = -10; Constant ANYTHING_RE_CC = -11; Constant NOTHING_RE_CC = -12; Constant RANGE_RE_CC = -13; Constant LCASE_RE_CC = -14; Constant NONLCASE_RE_CC = -15; Constant UCASE_RE_CC = -16; Constant NONUCASE_RE_CC = -17; ! Control structures Constant SUBEXP_RE_CC = -20; Constant DISJUNCTION_RE_CC = -21; Constant CHOICE_RE_CC = -22; Constant QUANTIFIER_RE_CC = -23; Constant IF_RE_CC = -24; Constant CONDITION_RE_CC = -25; Constant THEN_RE_CC = -26; Constant ELSE_RE_CC = -27; ! Substring matchers Constant VARIABLE_RE_CC = -30; Constant LITERAL_RE_CC = -31; ! Positional matchers Constant START_RE_CC = -40; Constant END_RE_CC = -41; Constant BOUNDARY_RE_CC = -42; Constant NONBOUNDARY_RE_CC = -43; Constant ALWAYS_RE_CC = -44; Constant NEVER_RE_CC = -45; ! Mode switches Constant SENSITIVITY_RE_CC = -50; Constant RE_MAX_PACKETS = 32; Constant RE_PACKET_SIZE = 14; ! Words of memory used per packet Constant RE_PACKET_SIZE_IN_BYTES = WORDSIZE*RE_PACKET_SIZE; ! Bytes used per packet Array RE_PACKET_space --> RE_MAX_PACKETS*RE_PACKET_SIZE; Constant RE_CCLASS = 0; ! One of the class codes defined above Constant RE_PAR1 = 1; ! Three parameters whose meaning depends on class code Constant RE_PAR2 = 2; Constant RE_PAR3 = 3; Constant RE_NEXT = 4; ! Younger sibling in the compiled tree Constant RE_PREVIOUS = 5; ! Elder sibling Constant RE_DOWN = 6; ! Child Constant RE_UP = 7; ! Parent Constant RE_DATA1 = 8; ! Backtracking data Constant RE_DATA2 = 9; Constant RE_CONSTRAINT = 10; Constant RE_CACHE1 = 11; Constant RE_CACHE2 = 12; Constant RE_MODES = 13; [ IT_RE_Node n cc par1 par2 par3 offset; if ((n<0) || (n >= RE_MAX_PACKETS)) rfalse; offset = RE_PACKET_space + n*RE_PACKET_SIZE_IN_BYTES; offset-->RE_CCLASS = cc; offset-->RE_PAR1 = par1; offset-->RE_PAR2 = par2; offset-->RE_PAR3 = par3; offset-->RE_NEXT = NULL; offset-->RE_PREVIOUS = NULL; offset-->RE_DOWN = NULL; offset-->RE_UP = NULL; offset-->RE_DATA1 = -1; ! Match start offset-->RE_DATA2 = -1; ! Match end offset-->RE_CONSTRAINT = -1; ! Rewind edge return offset; ]; [ IT_RE_NodeAddress n; if ((n<0) || (n >= RE_MAX_PACKETS)) return -1; return RE_PACKET_space + n*RE_PACKET_SIZE_IN_BYTES; ]; Array RE_Subexpressions --> 11; ! Address of node for this subexpression Array Allocated_Match_Vars --> 10; ! Indexed text to hold values of the variables [ IT_RE_DebugMatchVars indt offset n i; print RE_Subexpressions-->10, " collecting subexps^"; for (n=0:(n10) && (n<10): n++) { offset = RE_Subexpressions-->n; print "Subexp ", offset-->RE_PAR1, " = [", offset-->RE_DATA1, ",", offset-->RE_DATA2, "] = "; for (i=offset-->RE_DATA1:iRE_DATA2:i++) print (char) BlkValueRead(indt, i); print "^"; } ]; [ IT_RE_CreateMatchVars indt offset n i ch cindt cl csize; for (n=0:(n10) && (n<10): n++) { offset = RE_Subexpressions-->n; if (Allocated_Match_Vars-->n == 0) Allocated_Match_Vars-->n = INDEXED_TEXT_TY_Create(); ! Permanently cindt = Allocated_Match_Vars-->n; csize = BlkValueExtent(cindt); cl = 0; for (i=offset-->RE_DATA1:iRE_DATA2:i++) { ch = BlkValueRead(indt, i); if (cl+1 >= csize) { if (BlkValueSetExtent(cindt, 2*cl, 6) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } BlkValueWrite(cindt, cl, 0); } ]; [ IT_RE_EmptyMatchVars indt n; for (n=0:(n10) && (n<10): n++) if (Allocated_Match_Vars-->n ~= 0) BlkValueWrite(Allocated_Match_Vars-->n, 0, 0); ]; [ IT_RE_GetMatchVar indt vn offset; if ((vn<0) || (vn>=10) || (vn >= RE_Subexpressions-->10)) jump Nope; offset = RE_Subexpressions-->vn; if (offset == 0) jump Nope; if (offset-->RE_DATA1 < 0) jump Nope; if (Allocated_Match_Vars-->vn == 0) { print "*** ", vn, " unallocated! ***^"; jump Nope; } BlkValueCopy(indt, Allocated_Match_Vars-->vn); return indt; .Nope; BlkValueWrite(indt, 0, 0); return indt; ]; [ IT_MV_End n end offset; offset = RE_Subexpressions-->n; if (end==0) return offset-->RE_DATA1; return offset-->RE_DATA2; ]; [ IT_RE_Clear_Markers token; for (: token ~= NULL: token = token-->RE_NEXT) { if (token-->RE_DOWN ~= NULL) IT_RE_Clear_Markers(token-->RE_DOWN); token-->RE_DATA1 = -1; token-->RE_DATA2 = -1; token-->RE_CONSTRAINT = -1; } ]; [ IT_RE_DebugTree findt detail; print "Pattern: ", (INDEXED_TEXT_TY_Say) findt, "^"; IT_RE_DebugSubtree(findt, 1, RE_PACKET_space, detail); ]; [ IT_RE_DebugSubtree findt depth offset detail cup; if (offset ~= NULL) { cup = offset-->RE_UP; if (offset-->RE_PREVIOUS ~= NULL) print "*** broken initial previous ***^"; } while (offset ~= NULL) { if (offset-->RE_UP ~= cup) print "*** broken up matching ***^"; spaces(depth*2); IT_RE_DebugNode(offset, findt, detail); if (offset-->RE_DOWN ~= NULL) { if ((offset-->RE_DOWN)-->RE_UP ~= offset) print "*** broken down/up ***^"; IT_RE_DebugSubtree(findt, depth+1, offset-->RE_DOWN, detail); } if (offset-->RE_NEXT ~= NULL) { if ((offset-->RE_NEXT)-->RE_PREVIOUS ~= offset) print "*** broken next/previous ***^"; } offset = offset-->RE_NEXT; } ]; [ IT_RE_DebugNode offset findt detail i par1 par2 par3; if (offset == NULL) "[NULL]"; print "[", (offset-RE_PACKET_space)/(RE_PACKET_SIZE_IN_BYTES), "] "; ! for (i=0:ii, " "; par1 = offset-->RE_PAR1; par2 = offset-->RE_PAR2; par3 = offset-->RE_PAR3; switch (offset-->RE_CCLASS) { DIGIT_RE_CC: print "DIGIT"; NONDIGIT_RE_CC: print "NONDIGIT"; UCASE_RE_CC: print "UCASE"; NONUCASE_RE_CC: print "NONUCASE"; LCASE_RE_CC: print "LCASE"; NONLCASE_RE_CC: print "NONLCASE"; WHITESPACE_RE_CC: print "WHITESPACE"; NONWHITESPACE_RE_CC: print "NONWHITESPACE"; PUNCTUATION_RE_CC: print "PUNCTUATION"; NONPUNCTUATION_RE_CC: print "NONPUNCTUATION"; WORD_RE_CC: print "WORD"; NONWORD_RE_CC: print "NONWORD"; ALWAYS_RE_CC: print "ALWAYS"; NEVER_RE_CC: print "NEVER"; START_RE_CC: print "START"; END_RE_CC: print "END"; BOUNDARY_RE_CC: print "BOUNDARY"; NONBOUNDARY_RE_CC: print "NONBOUNDARY"; ANYTHING_RE_CC: print "ANYTHING"; NOTHING_RE_CC: print "NOTHING"; RANGE_RE_CC: print "RANGE"; if (par3 == true) print " (negated)"; print " "; for (i=par1:i= 0) print "= V", par1; if (par2 == 1) { if (par3 == 0) print " (?=...) lookahead"; else print " (?<=...) lookbehind of width ", par3; } if (par2 == 2) { if (par3 == 0) print " (?!...) negated lookahead"; else print " (?...) possessive"; NEWLINE_RE_CC: print "NEWLINE"; TAB_RE_CC: print "TAB"; QUANTIFIER_RE_CC: print "QUANTIFIER min=", par1, " max=", par2; if (par3) print " (lazy)"; else print " (greedy)"; LITERAL_RE_CC: print "LITERAL"; print " "; for (i=par1:i= 1) print " = V", par1; CONDITION_RE_CC: print "CONDITION"; if (par1 >= 1) print " = V", par1; THEN_RE_CC: print "THEN"; ELSE_RE_CC: print "ELSE"; } if (detail) print ": ", offset-->RE_DATA1, ", ", offset-->RE_DATA2, ", ", offset-->RE_CONSTRAINT; print "^"; ]; [ IT_CHR_CompileTree findt exactly root literal fto no_packets token attach_to; fto = IT_CharacterLength(findt); root = IT_RE_Node(0, SUBEXP_RE_CC, 0, 0, 0); literal = IT_RE_Node(1, LITERAL_RE_CC, 0, fto, 0); root-->RE_DOWN = literal; literal-->RE_UP = root; if (exactly) { no_packets = 2; if (no_packets+3 > RE_MAX_PACKETS) return "regexp too complex"; exactly = RE_PACKET_space-->RE_DOWN; token = IT_RE_Node(no_packets++, START_RE_CC, 0, 0, 0); RE_PACKET_space-->RE_DOWN = token; token-->RE_UP = RE_PACKET_space; attach_to = IT_RE_Node(no_packets++, SUBEXP_RE_CC, -1, 3, 0); token-->RE_NEXT = attach_to; attach_to-->RE_PREVIOUS = token; attach_to-->RE_UP = RE_PACKET_space; attach_to-->RE_NEXT = IT_RE_Node(no_packets++, END_RE_CC, 0, 0, 0); (attach_to-->RE_NEXT)-->RE_PREVIOUS = attach_to; (attach_to-->RE_NEXT)-->RE_UP = RE_PACKET_space; attach_to-->RE_DOWN = exactly; while (exactly ~= NULL) { exactly-->RE_UP = attach_to; exactly = exactly-->RE_NEXT; } } no_packets = IT_RE_ExpandChoices(RE_PACKET_space, no_packets); ]; Array Subexp_Posns --> 20; [ IT_RE_CompileTree findt exactly no_packets ffrom fto cc par1 par2 par3 quantifiable token attach_to no_subs blevel bits; fto = IT_CharacterLength(findt); if (fto == 0) { IT_RE_Node(no_packets++, NEVER_RE_CC, 0, 0, 0); ! Empty regexp never matches return 1; } attach_to = IT_RE_Node(no_packets++, SUBEXP_RE_CC, 0, 0, 0); RE_Subexpressions-->0 = attach_to; RE_Subexpressions-->10 = 1; no_subs = 1; quantifiable = false; blevel = 0; for (ffrom = 0: ffrom < fto: ) { cc = BlkValueRead(findt, ffrom++); par1 = 0; par2 = 0; par3 = 0; if (cc == '\') { if (ffrom == fto) return "Search pattern not terminated"; cc = BlkValueRead(findt, ffrom++); switch (cc) { 'b': cc = BOUNDARY_RE_CC; 'B': cc = NONBOUNDARY_RE_CC; 'd': cc = DIGIT_RE_CC; 'D': cc = NONDIGIT_RE_CC; 'l': cc = LCASE_RE_CC; 'L': cc = NONLCASE_RE_CC; 'n': cc = NEWLINE_RE_CC; 'p': cc = PUNCTUATION_RE_CC; 'P': cc = NONPUNCTUATION_RE_CC; 's': cc = WHITESPACE_RE_CC; 'S': cc = NONWHITESPACE_RE_CC; 't': cc = TAB_RE_CC; 'u': cc = UCASE_RE_CC; 'U': cc = NONUCASE_RE_CC; 'w': cc = WORD_RE_CC; 'W': cc = NONWORD_RE_CC; default: if ((cc >= '1') && (cc <= '9')) { par1 = cc-'0'; cc = VARIABLE_RE_CC; } else { if (((cc >= 'a') && (cc <= 'z')) || ((cc >= 'A') && (cc <= 'Z'))) return "unknown escape"; cc = LITERAL_RE_CC; par1 = ffrom-1; par2 = ffrom; } } quantifiable = true; } else { switch (cc) { '(': par2 = 0; !if (BlkValueRead(findt, ffrom) == ')') return "empty subexpression"; if (BlkValueRead(findt, ffrom) == '?') { ffrom++; bits = true; if (BlkValueRead(findt, ffrom) == '-') { ffrom++; bits = false; } else if (BlkValueRead(findt, ffrom) == '<') { ffrom++; bits = false; } switch (cc = BlkValueRead(findt, ffrom++)) { '#': while (BlkValueRead(findt, ffrom++) ~= 0 or ')') ; if (BlkValueRead(findt, ffrom-1) == 0) return "comment never ends"; continue; '(': cc = BlkValueRead(findt, ffrom); if ((cc == '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9') && (BlkValueRead(findt, ffrom+1) ==')')) { ffrom = ffrom + 2; par1 = cc - '0'; } else ffrom--; cc = IF_RE_CC; ! (?(...)...) conditional quantifiable = false; if (blevel == 20) return "subexpressions too deep"; Subexp_Posns-->(blevel++) = IT_RE_NodeAddress(no_packets); jump CClassKnown; '=': par2 = 1; ! (?=...) lookahead/behind par3 = 0; if (bits == false) par3 = -1; '!': par2 = 2; ! (?!...) negated lookahead/behind par3 = 0; if (bits == false) par3 = -1; ':': par2 = 3; ! (?:...) uncollecting subexpression '>': par2 = 4; ! (?>...) possessive default: if (BlkValueRead(findt, ffrom) == ')') { if (cc == 'i') { cc = SENSITIVITY_RE_CC; par1 = bits; ffrom++; jump CClassKnown; } } if (BlkValueRead(findt, ffrom) == ':') { if (cc == 'i') { par1 = bits; par2 = 3; par3 = bits+1; ffrom++; jump AllowForm; } } return "unknown (?...) form"; } } .AllowForm; if (par2 == 0) par1 = no_subs++; else par1 = -1; cc = SUBEXP_RE_CC; quantifiable = false; if (blevel == 20) return "subexpressions too deep"; Subexp_Posns-->(blevel++) = IT_RE_NodeAddress(no_packets); ')': if (blevel == 0) return "subexpression bracket mismatch"; blevel--; attach_to = Subexp_Posns-->blevel; if (attach_to-->RE_DOWN == NULL) { if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; attach_to-->RE_DOWN = IT_RE_Node(no_packets++, ALWAYS_RE_CC, 0, 0, 0); (attach_to-->RE_DOWN)-->RE_UP = attach_to; } quantifiable = true; continue; '.': cc = ANYTHING_RE_CC; quantifiable = true; '|': cc = CHOICE_RE_CC; quantifiable = false; '^': cc = START_RE_CC; quantifiable = false; '$': cc = END_RE_CC; quantifiable = false; '{': if (quantifiable == false) return "quantifier misplaced"; par1 = 0; par2 = -1; bits = 1; while ((cc=BlkValueRead(findt, ffrom++)) ~= 0 or '}') { if (cc == ',') { bits++; if (bits >= 3) return "too many colons in ?{...}"; continue; } if ((cc >= '0') || (cc <= '9')) { if (bits == 1) { if (par1 < 0) par1 = 0; par1 = par1*10 + (cc-'0'); } else { if (par2 < 0) par2 = 0; par2 = par2*10 + (cc-'0'); } } else return "non-digit in ?{...}"; } if (cc ~= '}') return "{x,y} quantifier never ends"; cc = QUANTIFIER_RE_CC; if (par2 == -1) { if (bits == 2) par2 = 30000; else par2 = par1; } if (par1 > par2) return "{x,y} with x greater than y"; if (BlkValueRead(findt, ffrom) == '?') { ffrom++; par3 = true; } quantifiable = false; '<', '[': par3 = false; if (cc == '<') bits = '>'; else bits = ']'; if (BlkValueRead(findt, ffrom) == '^') { ffrom++; par3 = true; } par1 = ffrom; if (BlkValueRead(findt, ffrom) == bits) { ffrom++; } while (cc ~= bits or 0) { cc = BlkValueRead(findt, ffrom++); if (cc == '\') { cc = BlkValueRead(findt, ffrom++); if (cc ~= 0) cc = BlkValueRead(findt, ffrom++); } } if (cc == 0) return "Character range never ends"; par2 = ffrom-1; if ((par2 > par1 + 1) && (BlkValueRead(findt, par1) == ':') && (BlkValueRead(findt, par2-1) == ':') && (BlkValueRead(findt, par2-2) ~= '\')) return "POSIX named character classes unsupported"; bits = IT_RE_RangeSyntaxCorrect(findt, par1, par2); if (bits) return bits; if (par1 < par2) cc = RANGE_RE_CC; else cc = NOTHING_RE_CC; quantifiable = true; '*': if (quantifiable == false) return "quantifier misplaced"; cc = QUANTIFIER_RE_CC; par1 = 0; par2 = 30000; if (BlkValueRead(findt, ffrom) == '?') { ffrom++; par3 = true; } quantifiable = false; '+': if (quantifiable == false) return "quantifier misplaced"; cc = QUANTIFIER_RE_CC; par1 = 1; par2 = 30000; if (BlkValueRead(findt, ffrom) == '?') { ffrom++; par3 = true; } quantifiable = false; '?': if (quantifiable == false) return "quantifier misplaced"; cc = QUANTIFIER_RE_CC; par1 = 0; par2 = 1; if (BlkValueRead(findt, ffrom) == '?') { ffrom++; par3 = true; } quantifiable = false; } } .CClassKnown; if (cc >= 0) { quantifiable = true; if ((attach_to-->RE_CCLASS == LITERAL_RE_CC) && (BlkValueRead(findt, ffrom) ~= '*' or '+' or '?' or '{')) { (attach_to-->RE_PAR2)++; if (IT_RE_Trace == 2) { print "Extending literal by ", cc, "=", (char) cc, "^"; } continue; } cc = LITERAL_RE_CC; par1 = ffrom-1; par2 = ffrom; } if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; if (IT_RE_Trace == 2) { print "Attaching packet ", no_packets+1, " to "; IT_RE_DebugNode(attach_to, findt); IT_RE_DebugTree(findt); } token = IT_RE_Node(no_packets++, cc, par1, par2, par3); if ((token-->RE_CCLASS == SUBEXP_RE_CC) && (token-->RE_PAR2 == 0)) { RE_Subexpressions-->(token-->RE_PAR1) = token; (RE_Subexpressions-->10)++; } if ((attach_to-->RE_CCLASS == SUBEXP_RE_CC or CHOICE_RE_CC or IF_RE_CC) && (attach_to-->RE_DOWN == NULL)) { attach_to-->RE_DOWN = token; token-->RE_UP = attach_to; } else { if ((token-->RE_CCLASS == CHOICE_RE_CC) && ((attach_to-->RE_UP)-->RE_CCLASS == CHOICE_RE_CC)) { no_packets--; token = attach_to-->RE_UP; } else { if (token-->RE_CCLASS == CHOICE_RE_CC) { while (attach_to-->RE_PREVIOUS ~= NULL) attach_to = attach_to-->RE_PREVIOUS; } if (token-->RE_CCLASS == QUANTIFIER_RE_CC or CHOICE_RE_CC) { token-->RE_PREVIOUS = attach_to-->RE_PREVIOUS; token-->RE_UP = attach_to-->RE_UP; if ((attach_to-->RE_UP ~= NULL) && (attach_to-->RE_PREVIOUS == NULL)) (attach_to-->RE_UP)-->RE_DOWN = token; token-->RE_DOWN = attach_to; bits = attach_to; while (bits ~= NULL) { bits-->RE_UP = token; bits = bits-->RE_NEXT; } attach_to-->RE_PREVIOUS = NULL; if (token-->RE_PREVIOUS ~= NULL) (token-->RE_PREVIOUS)-->RE_NEXT = token; } else { attach_to-->RE_NEXT = token; token-->RE_PREVIOUS = attach_to; token-->RE_UP = attach_to-->RE_UP; } } } if (token-->RE_CCLASS == CHOICE_RE_CC) { if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; token-->RE_NEXT = IT_RE_Node(no_packets++, CHOICE_RE_CC, 0, 0, 0); (token-->RE_NEXT)-->RE_PREVIOUS = token; (token-->RE_NEXT)-->RE_UP = token-->RE_UP; token = token-->RE_NEXT; } attach_to = token; if (IT_RE_Trace == 2) { print "Result:^"; IT_RE_DebugTree(findt); } } if (blevel ~= 0) return "subexpression bracket mismatch"; if (exactly) { if (no_packets+3 > RE_MAX_PACKETS) return "regexp too complex"; exactly = RE_PACKET_space-->RE_DOWN; token = IT_RE_Node(no_packets++, START_RE_CC, 0, 0, 0); RE_PACKET_space-->RE_DOWN = token; token-->RE_UP = RE_PACKET_space; attach_to = IT_RE_Node(no_packets++, SUBEXP_RE_CC, -1, 3, 0); token-->RE_NEXT = attach_to; attach_to-->RE_PREVIOUS = token; attach_to-->RE_UP = RE_PACKET_space; attach_to-->RE_NEXT = IT_RE_Node(no_packets++, END_RE_CC, 0, 0, 0); (attach_to-->RE_NEXT)-->RE_PREVIOUS = attach_to; (attach_to-->RE_NEXT)-->RE_UP = RE_PACKET_space; attach_to-->RE_DOWN = exactly; while (exactly ~= NULL) { exactly-->RE_UP = attach_to; exactly = exactly-->RE_NEXT; } } no_packets = IT_RE_ExpandChoices(RE_PACKET_space, no_packets); if (IT_RE_Trace) { print "Compiled pattern:^"; IT_RE_DebugTree(findt); } bits = IT_RE_CheckTree(RE_PACKET_space, no_subs); if (bits) return bits; return no_packets; ]; [ IT_RE_RangeSyntaxCorrect findt rf rt i chm; for (i=rf: i= 'a') && (chm <= 'z')) || ((chm >= 'A') && (chm <= 'Z'))) { if (chm ~= 's' or 'S' or 'p' or 'P' or 'w' or 'W' or 'd' or 'D' or 'n' or 't' or 'l' or 'L' or 'u' or 'U') return "Invalid escape in {} range"; } } if ((i+2 BlkValueRead(findt, i+2)) return "Invalid {} range"; i=i+2; } } rfalse; ]; [ IT_RE_ExpandChoices token no_packets rv prev nex holder new ct n cond_node then_node else_node; while (token ~= NULL) { if (token-->RE_CCLASS == IF_RE_CC) { if ((token-->RE_DOWN)-->RE_CCLASS == CHOICE_RE_CC) { for (nex=token-->RE_DOWN, n=0: nex~=NULL: nex=nex-->RE_NEXT) n++; if (n~=2) return "conditional has too many clauses"; if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; cond_node = IT_RE_Node(no_packets++, CONDITION_RE_CC, 0, 0, 0); if (token-->RE_PAR1 >= 1) { cond_node-->RE_PAR1 = token-->RE_PAR1; } then_node = token-->RE_DOWN; then_node-->RE_CCLASS = THEN_RE_CC; else_node = then_node-->RE_NEXT; else_node-->RE_CCLASS = ELSE_RE_CC; if (cond_node-->RE_PAR1 < 1) { cond_node-->RE_DOWN = then_node-->RE_DOWN; then_node-->RE_DOWN = (then_node-->RE_DOWN)-->RE_NEXT; if (then_node-->RE_DOWN ~= NULL) (then_node-->RE_DOWN)-->RE_PREVIOUS = NULL; (cond_node-->RE_DOWN)-->RE_NEXT = NULL; (cond_node-->RE_DOWN)-->RE_UP = cond_node; } token-->RE_DOWN = cond_node; cond_node-->RE_UP = token; cond_node-->RE_NEXT = then_node; then_node-->RE_PREVIOUS = cond_node; } else { if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; cond_node = IT_RE_Node(no_packets++, CONDITION_RE_CC, 0, 0, 0); if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; then_node = IT_RE_Node(no_packets++, THEN_RE_CC, 0, 0, 0); if (token-->RE_PAR1 >= 1) { cond_node-->RE_PAR1 = token-->RE_PAR1; then_node-->RE_DOWN = token-->RE_DOWN; } else { cond_node-->RE_DOWN = token-->RE_DOWN; then_node-->RE_DOWN = (token-->RE_DOWN)-->RE_NEXT; (cond_node-->RE_DOWN)-->RE_NEXT = NULL; (cond_node-->RE_DOWN)-->RE_UP = cond_node; } token-->RE_DOWN = cond_node; cond_node-->RE_UP = token; cond_node-->RE_NEXT = then_node; then_node-->RE_PREVIOUS = cond_node; then_node-->RE_UP = token; then_node-->RE_NEXT = NULL; if (then_node-->RE_DOWN ~= NULL) (then_node-->RE_DOWN)-->RE_PREVIOUS = NULL; for (nex = then_node-->RE_DOWN: nex ~= NULL: nex = nex-->RE_NEXT) { nex-->RE_UP = then_node; } } if (cond_node-->RE_DOWN ~= NULL) { nex = cond_node-->RE_DOWN; if ((nex-->RE_CCLASS ~= SUBEXP_RE_CC) || (nex-->RE_NEXT ~= NULL) || (nex-->RE_PAR2 ~= 1 or 2)) { !IT_RE_DebugSubtree(0, 0, nex, true); return "condition not lookahead/behind"; } } } if ((token-->RE_CCLASS == CHOICE_RE_CC) && (token-->RE_PAR1 < 1)) { prev = token-->RE_PREVIOUS; nex = token-->RE_NEXT; while ((nex ~= NULL) && (nex-->RE_CCLASS == CHOICE_RE_CC)) nex = nex-->RE_NEXT; holder = token-->RE_UP; if (holder == NULL) return "bang"; if (no_packets >= RE_MAX_PACKETS) return "regexp too complex"; new = IT_RE_Node(no_packets++, DISJUNCTION_RE_CC, 0, 0, 0); holder-->RE_DOWN = new; new-->RE_UP = holder; if (prev ~= NULL) { prev-->RE_NEXT = new; new-->RE_PREVIOUS = prev; } if (nex ~= NULL) { nex-->RE_PREVIOUS = new; new-->RE_NEXT = nex; } new-->RE_DOWN = token; token-->RE_PREVIOUS = NULL; ct = 1; while (token ~= NULL) { token-->RE_PAR1 = ct++; token-->RE_UP = new; if ((token-->RE_NEXT ~= NULL) && ((token-->RE_NEXT)-->RE_CCLASS ~= CHOICE_RE_CC)) token-->RE_NEXT = NULL; token = token-->RE_NEXT; } new-->RE_PAR1 = ct-1; if (token ~= NULL) token-->RE_NEXT = NULL; token = new; continue; } if (token-->RE_DOWN ~= NULL) { no_packets = IT_RE_ExpandChoices(token-->RE_DOWN, no_packets); if ((no_packets<0) || (no_packets >= RE_MAX_PACKETS)) break; } token = token-->RE_NEXT; } return no_packets; ]; [ IT_RE_CheckTree token no_subs rv; while (token ~= NULL) { if (token-->RE_CCLASS == VARIABLE_RE_CC) { if (token-->RE_PAR1 >= no_subs) return "reference to nonexistent group"; } if ((token-->RE_CCLASS == SUBEXP_RE_CC) && (token-->RE_PAR2 == 1 or 2) && (token-->RE_PAR3 == -1)) { token-->RE_PAR3 = IT_RE_Width(token-->RE_DOWN); if (token-->RE_PAR3 == -1) return "variable length lookbehind not implemented"; } if (token-->RE_DOWN ~= NULL) { rv = IT_RE_CheckTree(token-->RE_DOWN, no_subs); if (rv) return rv; } token = token-->RE_NEXT; } rfalse; ]; [ IT_RE_Width token downwards w rv aw choice; while (token ~= NULL) { switch (token-->RE_CCLASS) { DIGIT_RE_CC, NONDIGIT_RE_CC, WHITESPACE_RE_CC, NONWHITESPACE_RE_CC, PUNCTUATION_RE_CC, NONPUNCTUATION_RE_CC, WORD_RE_CC, NONWORD_RE_CC, ANYTHING_RE_CC, NOTHING_RE_CC, RANGE_RE_CC, NEWLINE_RE_CC, TAB_RE_CC, UCASE_RE_CC, NONUCASE_RE_CC, LCASE_RE_CC, NONLCASE_RE_CC: w++; START_RE_CC, END_RE_CC, BOUNDARY_RE_CC, NONBOUNDARY_RE_CC, ALWAYS_RE_CC: ; LITERAL_RE_CC: w = w + token-->RE_PAR2 - token-->RE_PAR1; VARIABLE_RE_CC: return -1; IF_RE_CC: rv = IT_RE_Width((token-->RE_DOWN)-->RE_NEXT); if (rv == -1) return -1; if (rv ~= IT_RE_Width(((token-->RE_DOWN)-->RE_NEXT)-->RE_NEXT)) return -1; w = w + rv; SUBEXP_RE_CC: if (token-->RE_PAR2 == 1 or 2) rv = 0; else { rv = IT_RE_Width(token-->RE_DOWN); if (rv == -1) return -1; } w = w + rv; QUANTIFIER_RE_CC: if (token-->RE_PAR1 ~= token-->RE_PAR2) return -1; rv = IT_RE_Width(token-->RE_DOWN); if (rv == -1) return -1; w = w + rv*(token-->RE_PAR1); DISJUNCTION_RE_CC: aw = -1; for (choice = token-->RE_DOWN: choice ~= NULL: choice = choice-->RE_NEXT) { rv = IT_RE_Width(choice-->RE_DOWN); !print "Option found ", rv, "^"; if (rv == -1) return -1; if ((aw >= 0) && (aw ~= rv)) return -1; aw = rv; } w = w + aw; SENSITIVITY_RE_CC: ; } if (downwards) return w; if (token ~= NULL) token = token-->RE_NEXT; } return w; ]; Global IT_RE_RewindCount; [ IT_RE_PrintNoRewinds; print IT_RE_RewindCount; ]; Constant CIS_MFLAG = 1; Constant ACCUM_MFLAG = 2; [ IT_RE_Parse findt indt ipos insens ilen rv root i initial_mode; ilen = IT_CharacterLength(indt); if ((ipos<0) || (ipos>ilen)) return -1; root = RE_PACKET_space; initial_mode = 0; if (insens) initial_mode = CIS_MFLAG; IT_RE_Clear_Markers(RE_PACKET_space); for (:ipos<=ilen:ipos++) { if ((RE_PACKET_space-->RE_DOWN ~= NULL) && ((RE_PACKET_space-->RE_DOWN)-->RE_CCLASS == START_RE_CC) && (ipos>0)) { rv = -1; break; } if (ipos > 0) IT_RE_EraseConstraints(RE_PACKET_space, initial_mode); IT_RE_RewindCount = 0; rv = IT_RE_ParseAtPosition(findt, indt, ipos, ilen, RE_PACKET_space, initial_mode); if (rv >= 0) break; } if (rv == -1) { root-->RE_DATA1 = -1; root-->RE_DATA2 = -1; } else { root-->RE_DATA1 = ipos; root-->RE_DATA2 = ipos+rv; } return rv; ]; [ IT_RE_ParseAtPosition findt indt ifrom ito token mode_flags outcome ipos npos rv i ch edge rewind_this; if (ifrom > ito) return -1; ipos = ifrom; .Rewind; while (token ~= NULL) { outcome = false; if (IT_RE_Trace) { print "Matching at ", ipos, ": "; IT_RE_DebugNode(token, findt, true); } if (iposRE_MODES = mode_flags; ! Save in case of backtrack switch (token-->RE_CCLASS) { ! Should never happen CHOICE_RE_CC: return "internal error"; ! Mode switches SENSITIVITY_RE_CC: if (token-->RE_PAR1) mode_flags = mode_flags | CIS_MFLAG; else mode_flags = mode_flags & (~CIS_MFLAG); outcome = true; ! Zero-length positional markers ALWAYS_RE_CC: outcome = true; NEVER_RE_CC: START_RE_CC: if (ipos == 0) outcome = true; END_RE_CC: if (BlkValueRead(indt, ipos) == 0) outcome = true; BOUNDARY_RE_CC: rv = 0; if (BlkValueRead(indt, ipos) == 0 or 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') rv++; if (ipos == 0) ch = 0; else ch = BlkValueRead(indt, ipos-1); if (ch == 0 or 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') rv++; if (rv == 1) outcome = true; NONBOUNDARY_RE_CC: rv = 0; if (BlkValueRead(indt, ipos) == 0 or 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') rv++; if (ipos == 0) ch = 0; else ch = BlkValueRead(indt, ipos-1); if (ch == 0 or 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') rv++; if (rv ~= 1) outcome = true; ! Control constructs IF_RE_CC: i = token-->RE_PAR1; ch = false; if (IT_RE_Trace) { print "Trying conditional from ", ipos, ": "; IT_RE_DebugNode(token, findt, true); } if (i >= 1) { if ((i10) && ((RE_Subexpressions-->i)-->RE_DATA1 >= 0)) ch = true; } else { rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, (token-->RE_DOWN)-->RE_DOWN, mode_flags); if (rv >= 0) ch = true; } if (IT_RE_Trace) { print "Condition found to be ", ch, "^"; } if (ch) { rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, ((token-->RE_DOWN)-->RE_NEXT)-->RE_DOWN, mode_flags); !print "Then clause returned ", rv, "^"; } else { if ((((token-->RE_DOWN)-->RE_NEXT)-->RE_NEXT) == NULL) rv = 0; ! The empty else clause matches else rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, (((token-->RE_DOWN)-->RE_NEXT)-->RE_NEXT)-->RE_DOWN, mode_flags); !print "Else clause returned ", rv, "^"; } if (rv >= 0) { outcome = true; ipos = ipos + rv; } DISJUNCTION_RE_CC: if (IT_RE_Trace) { print "Trying disjunction from ", ipos, ": "; IT_RE_DebugNode(token, findt, true); } for (ch = token-->RE_DOWN: ch ~= NULL: ch = ch-->RE_NEXT) { if (ch-->RE_PAR1 <= token-->RE_CONSTRAINT) continue; if (IT_RE_Trace) { print "Trying choice at ", ipos, ": "; IT_RE_DebugNode(ch, findt, true); } rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, ch-->RE_DOWN, mode_flags); if (rv >= 0) { token-->RE_DATA1 = ipos; ! Where match was made token-->RE_DATA2 = ch-->RE_PAR1; ! Option taken ipos = ipos + rv; outcome = true; if (IT_RE_Trace) { print "Choice worked with width ", rv, ": "; IT_RE_DebugNode(ch, findt, true); } break; } else { if (mode_flags & ACCUM_MFLAG == false) IT_RE_FailSubexpressions(ch-->RE_DOWN); } } if (outcome == false) { if (IT_RE_Trace) { print "Failed disjunction from ", ipos, ": "; IT_RE_DebugNode(token, findt, true); } token-->RE_DATA1 = ipos; ! Where match was tried token-->RE_DATA2 = -1; ! No option was taken } SUBEXP_RE_CC: if (token-->RE_PAR2 == 1 or 2) { npos = ipos - token-->RE_PAR3; if (npos<0) rv = -1; ! Lookbehind fails: nothing behind else rv = IT_RE_ParseAtPosition(findt, indt, npos, ito, token-->RE_DOWN, mode_flags); } else { switch (token-->RE_PAR3) { 0: rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, token-->RE_DOWN, mode_flags); 1: rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, token-->RE_DOWN, mode_flags & (~CIS_MFLAG)); 2: rv = IT_RE_ParseAtPosition(findt, indt, ipos, ito, token-->RE_DOWN, mode_flags | CIS_MFLAG); } } npos = ipos; if (rv >= 0) npos = ipos + rv; switch (token-->RE_PAR2) { 1: if (rv >= 0) rv = 0; 2: if (rv >= 0) rv = -1; else rv = 0; } if (rv >= 0) { token-->RE_DATA1 = ipos; ipos = ipos + rv; token-->RE_DATA2 = npos; outcome = true; } else { if (mode_flags & ACCUM_MFLAG == false) { token-->RE_DATA1 = -1; token-->RE_DATA2 = -1; } } if (token-->RE_PAR2 == 2) IT_RE_FailSubexpressions(token, true); QUANTIFIER_RE_CC: token-->RE_DATA1 = ipos; if ((token-->RE_DOWN)-->RE_CCLASS == SUBEXP_RE_CC) { (token-->RE_DOWN)-->RE_CACHE1 = -1; (token-->RE_DOWN)-->RE_CACHE2 = -1; } if (IT_RE_Trace) { print "Trying quantifier from ", ipos, ": "; IT_RE_DebugNode(token, findt, true); } if (token-->RE_PAR3 == false) { ! Greedy quantifier !edge = ito; if (token-->RE_CONSTRAINT >= 0) edge = token-->RE_CONSTRAINT; edge = token-->RE_PAR2; if (token-->RE_CONSTRAINT >= 0) edge = token-->RE_CONSTRAINT; rv = -1; for (i=0, npos=ipos: iRE_DOWN, mode_flags | ACCUM_MFLAG); if (rv < 0) break; if ((token-->RE_DOWN)-->RE_CCLASS == SUBEXP_RE_CC) { (token-->RE_DOWN)-->RE_CACHE1 = (token-->RE_DOWN)-->RE_DATA1; (token-->RE_DOWN)-->RE_CACHE2 = (token-->RE_DOWN)-->RE_DATA2; } if ((rv == 0) && (token-->RE_PAR2 == 30000) && (i>=1)) { i++; break; } npos = npos + rv; } if ((i >= token-->RE_PAR1) && (i <= token-->RE_PAR2)) outcome = true; } else { ! Lazy quantifier edge = token-->RE_PAR1; if (token-->RE_CONSTRAINT > edge) edge = token-->RE_CONSTRAINT; for (i=0, npos=ipos: (nposRE_PAR2): i++) { if (i >= edge) break; if (IT_RE_Trace) { print "Trying quant rep ", i+1, " at ", npos, ": "; IT_RE_DebugNode(token, findt, true); } rv = IT_RE_ParseAtPosition(findt, indt, npos, ito, token-->RE_DOWN, mode_flags | ACCUM_MFLAG); if (rv < 0) break; if ((token-->RE_DOWN)-->RE_CCLASS == SUBEXP_RE_CC) { (token-->RE_DOWN)-->RE_CACHE1 = (token-->RE_DOWN)-->RE_DATA1; (token-->RE_DOWN)-->RE_CACHE2 = (token-->RE_DOWN)-->RE_DATA2; } if ((rv == 0) && (token-->RE_PAR2 == 30000) && (i>=1)) { i++; break; } npos = npos + rv; } if ((i >= edge) && (i <= token-->RE_PAR2)) outcome = true; } if (outcome) { if (token-->RE_PAR3 == false) { ! Greedy quantifier if (i > token-->RE_PAR1) { ! I.e., if we have been greedy token-->RE_DATA2 = i-1; ! And its edge limitation } else { token-->RE_DATA2 = -1; } } else { ! Lazy quantifier if (i < token-->RE_PAR2) { ! I.e., if we have been lazy token-->RE_DATA2 = i+1; ! And its edge limitation } else { token-->RE_DATA2 = -1; } } ipos = npos; if ((i == 0) && (mode_flags & ACCUM_MFLAG == false)) IT_RE_FailSubexpressions(token-->RE_DOWN); if ((token-->RE_DOWN)-->RE_CCLASS == SUBEXP_RE_CC) { (token-->RE_DOWN)-->RE_DATA1 = (token-->RE_DOWN)-->RE_CACHE1; (token-->RE_DOWN)-->RE_DATA2 = (token-->RE_DOWN)-->RE_CACHE2; } if (IT_RE_Trace) { print "Successful quant reps ", i, ": "; IT_RE_DebugNode(token, findt, true); } } else { !token-->RE_DATA2 = -1; if (mode_flags & ACCUM_MFLAG == false) IT_RE_FailSubexpressions(token-->RE_DOWN); if (IT_RE_Trace) { print "Failed quant reps ", i, ": "; IT_RE_DebugNode(token, findt, true); } } ! Character classes NOTHING_RE_CC: ; ANYTHING_RE_CC: if (ch) outcome = true; ipos++; WHITESPACE_RE_CC: if (ch == 10 or 13 or 32 or 9) { outcome = true; ipos++; } NONWHITESPACE_RE_CC: if ((ch) && (ch ~= 10 or 13 or 32 or 9)) { outcome = true; ipos++; } PUNCTUATION_RE_CC: if (ch == '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') { outcome = true; ipos++; } NONPUNCTUATION_RE_CC: if ((ch) && (ch ~= '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}')) { outcome = true; ipos++; } WORD_RE_CC: if ((ch) && (ch ~= 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}')) { outcome = true; ipos++; } NONWORD_RE_CC: if (ch == 10 or 13 or 32 or 9 or '.' or ',' or '!' or '?' or '-' or '/' or '"' or ':' or ';' or '(' or ')' or '[' or ']' or '{' or '}') { outcome = true; ipos++; } DIGIT_RE_CC: if (ch == '0' or '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9') { outcome = true; ipos++; } NONDIGIT_RE_CC: if ((ch) && (ch ~= '0' or '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9')) { outcome = true; ipos++; } LCASE_RE_CC: if (CharIsOfCase(ch, 0)) { outcome = true; ipos++; } NONLCASE_RE_CC: if ((ch) && (CharIsOfCase(ch, 0) == false)) { outcome = true; ipos++; } UCASE_RE_CC: if (CharIsOfCase(ch, 1)) { outcome = true; ipos++; } NONUCASE_RE_CC: if ((ch) && (CharIsOfCase(ch, 1) == false)) { outcome = true; ipos++; } NEWLINE_RE_CC: if (ch == 10) { outcome = true; ipos++; } TAB_RE_CC: if (ch == 9) { outcome = true; ipos++; } RANGE_RE_CC: if (IT_RE_Range(ch, findt, token-->RE_PAR1, token-->RE_PAR2, token-->RE_PAR3, mode_flags & CIS_MFLAG)) { outcome = true; ipos++; } ! Substring matches LITERAL_RE_CC: rv = IT_RE_MatchSubstring(indt, ipos, findt, token-->RE_PAR1, token-->RE_PAR2, mode_flags & CIS_MFLAG); if (rv >= 0) { ipos = ipos + rv; outcome = true; } VARIABLE_RE_CC: i = token-->RE_PAR1; if ((RE_Subexpressions-->i)-->RE_DATA1 >= 0) { rv = IT_RE_MatchSubstring(indt, ipos, indt, (RE_Subexpressions-->i)-->RE_DATA1, (RE_Subexpressions-->i)-->RE_DATA2, mode_flags & CIS_MFLAG); if (rv >= 0) { ipos = ipos + rv; outcome = true; } } .NeverMatchIncompleteVar; } if (outcome == false) { if (IT_RE_RewindCount++ >= 10000) { if (IT_RE_RewindCount == 10001) { style bold; print "OVERFLOW^"; style roman; } return -1; } if (IT_RE_Trace) { print "Rewind sought from failure at pos ", ipos, " with: "; IT_RE_DebugNode(token, findt, true); } if ((token-->RE_CCLASS == QUANTIFIER_RE_CC) && (IT_RE_SeekBacktrack(token-->RE_DOWN, findt, false, ito, false))) jump RewindFound; if (mode_flags & ACCUM_MFLAG == false) IT_RE_FailSubexpressions(token); token = token-->RE_PREVIOUS; while (token ~= NULL) { if (IT_RE_SeekBacktrack(token, findt, true, ito, false)) { .RewindFound; ipos = token-->RE_DATA1; mode_flags = token-->RE_MODES; if (mode_flags & ACCUM_MFLAG == false) IT_RE_FailSubexpressions(token, true); if (ipos == -1) IT_RE_DebugTree(findt, true); if (IT_RE_Trace) { print "^[", ifrom, ",", ito, "] rewinding to ", ipos, " at "; IT_RE_DebugNode(token, findt, true); } jump Rewind; } token = token-->RE_PREVIOUS; } if (IT_RE_Trace) print "^Rewind impossible^"; return -1; } token = token-->RE_NEXT; } return ipos - ifrom; ]; [ IT_RE_SeekBacktrack token findt downwards ito report_only untried; for (: token ~= NULL: token = token-->RE_NEXT) { if ((IT_RE_Trace) && (report_only == false)) { print "Scan for rewind: "; IT_RE_DebugNode(token, findt, true); } if ((token-->RE_CCLASS == SUBEXP_RE_CC) && (token-->RE_PAR2 == 1 or 2 or 4)) { if (downwards) rfalse; continue; } if (token-->RE_DOWN ~= NULL) { if ((IT_RE_Trace) && (report_only == false)) print "Descend^"; if (IT_RE_SeekBacktrack(token-->RE_DOWN, findt, false, ito, report_only)) rtrue; } untried = false; switch (token-->RE_CCLASS) { DISJUNCTION_RE_CC: if ((token-->RE_DATA2 >= 1) && (token-->RE_DATA2 < token-->RE_PAR1) && (token-->RE_CONSTRAINT < token-->RE_PAR1)) { ! Matched but earlier than last if (report_only) rtrue; if (token-->RE_CONSTRAINT == -1) token-->RE_CONSTRAINT = 1; else (token-->RE_CONSTRAINT)++; untried = true; } QUANTIFIER_RE_CC: if (token-->RE_CONSTRAINT ~= -2) { if ((IT_RE_Trace) && (report_only == false)) { print "Quant with cons not -2: "; IT_RE_DebugNode(token, findt, true); } if (token-->RE_DATA2 >= 0) { if (report_only) rtrue; token-->RE_CONSTRAINT = token-->RE_DATA2; untried = true; } } } if (untried) { if (IT_RE_Trace) { print "Grounds for rewind at: "; IT_RE_DebugNode(token, findt, true); } IT_RE_EraseConstraints(token-->RE_NEXT); IT_RE_EraseConstraints(token-->RE_DOWN); rtrue; } if (downwards) rfalse; } rfalse; ]; [ IT_RE_FailSubexpressions token downwards; for (: token ~= NULL: token = token-->RE_NEXT) { if (token-->RE_DOWN ~= NULL) IT_RE_FailSubexpressions(token-->RE_DOWN); if (token-->RE_CCLASS == SUBEXP_RE_CC) { token-->RE_DATA1 = -1; token-->RE_DATA2 = -1; } if (downwards) break; } ]; [ IT_RE_EraseConstraints token; while (token ~= NULL) { switch (token-->RE_CCLASS) { DISJUNCTION_RE_CC: token-->RE_CONSTRAINT = -1; QUANTIFIER_RE_CC: token-->RE_CONSTRAINT = -1; } if (token-->RE_DOWN) IT_RE_EraseConstraints(token-->RE_DOWN); token = token-->RE_NEXT; } ]; [ IT_RE_MatchSubstring indt ipos mindt mfrom mto insens i ch; if (mfrom < 0) return 0; if (insens) for (i=mfrom:i= chm) && (ch <= upper)) rtrue; if (insens) { crev = IT_RevCase(ch); if ((crev >= chm) && (crev <= upper)) rtrue; } i=i+2; } else { if (chm == ch) rtrue; if ((insens) && (chm == IT_RevCase(ch))) rtrue; } } rfalse; ]; [ IT_Replace_RE findtype indt findt rindt insens exactly cindt csize ilen i cl mpos cpos ch chm; ilen = IT_CharacterLength(indt); IT_RE_Err = 0; switch (findtype) { REGEXP_BLOB: i = IT_RE_CompileTree(findt, exactly); CHR_BLOB: i = IT_CHR_CompileTree(findt, exactly); default: "*** bad findtype ***"; } if ((i<0) || (i>RE_MAX_PACKETS)) { IT_RE_Err = i; print "*** Regular expression error: ", (string) IT_RE_Err, " ***^"; RunTimeProblem(RTP_REGEXPSYNTAXERROR); return 0; } if (IT_RE_Trace) { IT_RE_DebugTree(findt); print "(compiled to ", i, " packets)^"; } if (findtype == REGEXP_BLOB) IT_RE_EmptyMatchVars(); mpos = 0; chm = 0; cpos = 0; while (IT_RE_Parse(findt, indt, mpos, insens) >= 0) { chm++; if (IT_RE_Trace) { print "^*** Match ", chm, " found (", RE_PACKET_space-->RE_DATA1, ",", RE_PACKET_space-->RE_DATA2, "): "; if (RE_PACKET_space-->RE_DATA1 == RE_PACKET_space-->RE_DATA2) { print ""; } for (i=RE_PACKET_space-->RE_DATA1:iRE_DATA2:i++) { print (char) BlkValueRead(indt, i); } print " ***^"; } if (rindt == 0) break; ! Accept only one match, replace nothing if (rindt ~= 0 or 1) { if (chm == 1) { cindt = BlkValueCreate(INDEXED_TEXT_TY); csize = BlkValueExtent(cindt); } for (i=cpos:iRE_DATA1:i++) { ch = BlkValueRead(indt, i); if (cl+1 >= csize) { if (BlkValueSetExtent(cindt, 2*cl, 7) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } BlkValueWrite(cindt, cl, 0); IT_Concatenate(cindt, rindt, findtype, indt); csize = BlkValueExtent(cindt); cl = IT_CharacterLength(cindt); } mpos = RE_PACKET_space-->RE_DATA2; cpos = mpos; if (RE_PACKET_space-->RE_DATA1 == RE_PACKET_space-->RE_DATA2) mpos++; if (IT_RE_Trace) { if (chm == 100) { ! Purely to keep the output from being excessive print "(Stopping after 100 matches.)^"; break; } } } if (chm > 0) { if (rindt ~= 0 or 1) { for (i=cpos:i= csize) { if (BlkValueSetExtent(cindt, 2*cl, 8) == false) break; csize = BlkValueExtent(cindt); } BlkValueWrite(cindt, cl++, ch); } } if (findtype == REGEXP_BLOB) { IT_RE_CreateMatchVars(indt); if (IT_RE_Trace) IT_RE_DebugMatchVars(indt); } if (rindt ~= 0 or 1) { BlkValueWrite(cindt, cl, 0); BlkValueCopy(indt, cindt); BlkFree(cindt); } } return chm; ]; [ IT_RE_Concatenate indt_to indt_from blobtype indt_ref pos len ch i tosize x y case; if ((indt_to==0) || (BlkType(indt_to) ~= INDEXED_TEXT_TY)) rfalse; if ((indt_from==0) || (BlkType(indt_from) ~= INDEXED_TEXT_TY)) return indt_to; pos = IT_CharacterLength(indt_to); tosize = BlkValueExtent(indt_to); len = IT_CharacterLength(indt_from); for (i=0:i= 0) ch = BlkValueRead(indt_from, ++i); if ((ch >= '0') && (ch <= '9')) { ch = ch - '0'; if (ch < RE_Subexpressions-->10) { x = (RE_Subexpressions-->ch)-->RE_DATA1; y = (RE_Subexpressions-->ch)-->RE_DATA2; if (x >= 0) { for (:x= tosize) { if (BlkValueSetExtent(indt_to, 2*tosize, 11) == false) break; tosize = BlkValueExtent(indt_to); } if (case >= 0) BlkValueWrite(indt_to, pos++, CharToCase(ch, case)); else BlkValueWrite(indt_to, pos++, ch); } } } continue; } } if (pos+1 >= tosize) { if (BlkValueSetExtent(indt_to, 2*tosize, 12) == false) break; tosize = BlkValueExtent(indt_to); } BlkValueWrite(indt_to, pos++, ch); } BlkValueWrite(indt_to, pos, 0); return indt_to; ]; #ENDIF; ! IFDEF MEMORY_HEAP_SIZE #IFDEF MEMORY_HEAP_SIZE; ! Will exist if any use is made of indexed texts [ STORED_ACTION_TY_Support task arg1 arg2 arg3; switch(task) { CREATE_KOVS: return STORED_ACTION_TY_Create(); CAST_KOVS: rfalse; DESTROY_KOVS: return STORED_ACTION_TY_Destroy(arg1); PRECOPY_KOVS: rfalse; COPY_KOVS: return STORED_ACTION_TY_Copy(arg1, arg2); COMPARE_KOVS: return STORED_ACTION_TY_Compare(arg1, arg2); READ_FILE_KOVS: rfalse; WRITE_FILE_KOVS: rfalse; } ]; [ STORED_ACTION_TY_Create stora; stora = BlkAllocate(6*WORDSIZE, STORED_ACTION_TY, BLK_FLAG_WORD); BlkValueWrite(stora, 0, ##Wait); ! action BlkValueWrite(stora, 1, 0); ! noun BlkValueWrite(stora, 2, 0); ! second BlkValueWrite(stora, 3, player); ! actor BlkValueWrite(stora, 4, false); ! whether a request BlkValueWrite(stora, 5, 0); ! indexed text of command if necessary, 0 if not return stora; ]; [ STORED_ACTION_TY_New a n s ac req stora; if (stora == 0) stora = STORED_ACTION_TY_Create(); BlkValueWrite(stora, 0, a); BlkValueWrite(stora, 1, n); BlkValueWrite(stora, 2, s); BlkValueWrite(stora, 3, ac); BlkValueWrite(stora, 4, req); BlkValueWrite(stora, 5, 0); return stora; ]; [ STORED_ACTION_TY_Destroy stora toc; toc = BlkValueRead(stora, 5); if (toc) BlkFree(toc); ]; [ STORED_ACTION_TY_Copy storato storafrom tocfrom tocto; tocfrom = BlkValueRead(storafrom, 5); if (tocfrom == 0) return; tocto = INDEXED_TEXT_TY_Support(CREATE_KOVS); BlkValueCopy(tocto, tocfrom); BlkValueWrite(storato, 5, tocto); ]; [ STORED_ACTION_TY_Compare storaleft storaright delta itleft itright; delta = BlkValueRead(storaleft, 0) - BlkValueRead(storaright, 0); if (delta) return delta; delta = BlkValueRead(storaleft, 1) - BlkValueRead(storaright, 1); if (delta) return delta; delta = BlkValueRead(storaleft, 2) - BlkValueRead(storaright, 2); if (delta) return delta; delta = BlkValueRead(storaleft, 3) - BlkValueRead(storaright, 3); if (delta) return delta; delta = BlkValueRead(storaleft, 4) - BlkValueRead(storaright, 4); if (delta) return delta; itleft = BlkValueRead(storaleft, 5); itright = BlkValueRead(storaright, 5); if ((itleft ~= 0) && (itright ~= 0)) return INDEXED_TEXT_TY_Support(COMPARE_KOVS, itleft, itright); return itleft - itright; ]; [ STORED_ACTION_TY_Distinguish stora1 stora2; if (STORED_ACTION_TY_Compare(stora1, stora2) == 0) rfalse; rtrue; ]; [ STORED_ACTION_TY_Say stora text_of_command saved_command; if ((stora==0) || (BlkType(stora) ~= STORED_ACTION_TY)) return; text_of_command = BlkValueRead(stora, 5); if (text_of_command) { saved_command = INDEXED_TEXT_TY_Support(CREATE_KOVS); INDEXED_TEXT_TY_Support(CAST_KOVS, players_command, SNIPPET_TY, saved_command); SetPlayersCommand(text_of_command); } DB_Action(BlkValueRead(stora, 3), BlkValueRead(stora, 4), BlkValueRead(stora, 0), BlkValueRead(stora, 1), BlkValueRead(stora, 2), true); if (text_of_command) { SetPlayersCommand(saved_command); BlkFree(saved_command); } ]; [ STORED_ACTION_TY_Involves stora item at; at = FindAction(BlkValueRead(stora, 0)); if (at) { if ((ActionData-->(at+AD_NOUN_KOV) == OBJECT_TY) && (BlkValueRead(stora, 1) == item)) rtrue; if ((ActionData-->(at+AD_SECOND_KOV) == OBJECT_TY) && (BlkValueRead(stora, 2) == item)) rtrue; } if (BlkValueRead(stora, 3) == item) rtrue; rfalse; ]; [ STORED_ACTION_TY_Part stora ind at ado; if (ind == 1 or 2) { if (ind == 1) ado = AD_NOUN_KOV; else ado = AD_SECOND_KOV; at = FindAction(BlkValueRead(stora, 0)); if ((at) && (ActionData-->(at+ado) == OBJECT_TY)) return BlkValueRead(stora, ind); return nothing; } return BlkValueRead(stora, ind); ]; Array SAT_Tmp-->6; [ STORED_ACTION_TY_Adopt stora; SAT_Tmp-->1 = action; SAT_Tmp-->2 = noun; SAT_Tmp-->3 = second; SAT_Tmp-->4 = actor; SAT_Tmp-->5 = act_requester; action = BlkValueRead(stora, 0); noun = BlkValueRead(stora, 1); second = BlkValueRead(stora, 2); actor = BlkValueRead(stora, 3); if (BlkValueRead(stora, 4)) act_requester = player; else act_requester = nothing; ]; [ STORED_ACTION_TY_Unadopt; action = SAT_Tmp-->1; noun = SAT_Tmp-->2; second = SAT_Tmp-->3; actor = SAT_Tmp-->4; act_requester = SAT_Tmp-->5; return SAT_Tmp-->0; ]; [ STORED_ACTION_TY_Current stora at text_of_command; if ((stora==0) || (BlkType(stora) ~= STORED_ACTION_TY)) return 0; BlkValueWrite(stora, 0, action); BlkValueWrite(stora, 1, noun); BlkValueWrite(stora, 2, second); BlkValueWrite(stora, 3, actor); if (act_requester) BlkValueWrite(stora, 4, true); else BlkValueWrite(stora, 4, false); at = FindAction(-1); if ((at) && ((ActionData-->(at+AD_NOUN_KOV) == UNDERSTANDING_TY) || (ActionData-->(at+AD_SECOND_KOV) == UNDERSTANDING_TY))) { text_of_command = BlkValueRead(stora, 5); if (text_of_command == 0) { text_of_command = INDEXED_TEXT_TY_Support(CREATE_KOVS); BlkValueWrite(stora, 5, text_of_command); } INDEXED_TEXT_TY_Support(CAST_KOVS, players_command, SNIPPET_TY, text_of_command); } else BlkValueWrite(stora, 5, 0); return stora; ]; [ STORED_ACTION_TY_Try stora ks text_of_command saved_command; if ((stora==0) || (BlkType(stora) ~= STORED_ACTION_TY)) return; if (ks) { @push keep_silent; keep_silent=1; } text_of_command = BlkValueRead(stora, 5); if (text_of_command) { saved_command = INDEXED_TEXT_TY_Support(CREATE_KOVS); INDEXED_TEXT_TY_Support(CAST_KOVS, players_command, SNIPPET_TY, saved_command); SetPlayersCommand(text_of_command); } TryAction(BlkValueRead(stora, 4), BlkValueRead(stora, 3), BlkValueRead(stora, 0), BlkValueRead(stora, 1), BlkValueRead(stora, 2)); if (text_of_command) { SetPlayersCommand(saved_command); BlkFree(saved_command); } if (ks) { @pull keep_silent; } ]; #IFNOT; ! IFDEF MEMORY_HEAP_SIZE [ STORED_ACTION_TY_Say stora; ]; [ STORED_ACTION_TY_New a n s ac req stora; return false; ]; [ STORED_ACTION_TY_Support t a b c; rfalse; ]; #ENDIF; ! IFDEF MEMORY_HEAP_SIZE #IFDEF MEMORY_HEAP_SIZE; ! Will exist if any use is made of heap [ LIST_OF_TY_Support task arg1 arg2 arg3; switch(task) { CREATE_KOVS: arg3 = LIST_OF_TY_Create(arg2); if (arg1) LIST_OF_TY_CopyRawArray(arg3, arg1, 2); return arg3; CAST_KOVS: rfalse; DESTROY_KOVS: return LIST_OF_TY_Destroy(arg1); PRECOPY_KOVS: return LIST_OF_TY_PreCopy(arg1, arg2); COPY_KOVS: return LIST_OF_TY_Copy(arg1, arg2); COMPARE_KOVS: return LIST_OF_TY_Compare(arg1, arg2); READ_FILE_KOVS: rfalse; WRITE_FILE_KOVS: rfalse; } ]; Constant LIST_ITEM_KOV_F = 0; ! Entry 0: base KOV stored within Constant LIST_LENGTH_F = 1; ! Entry 1: length, i.e., number of items Constant LIST_ITEM_COMPARE_F = 2; ! Entry 2: comparison function for items Constant LIST_ITEM_BASE = 3; ! List items begin at this entry [ LIST_OF_TY_Create skov list; list = BlkAllocate(28*WORDSIZE, LIST_OF_TY, BLK_FLAG_MULTIPLE + BLK_FLAG_WORD); BlkValueWrite(list, LIST_ITEM_KOV_F, skov); BlkValueWrite(list, LIST_LENGTH_F, 0); BlkValueWrite(list, LIST_ITEM_COMPARE_F, KOVComparisonFunction(skov)); return list; ]; [ LIST_OF_TY_CopyRawArray list arr rea len i ex bk v w; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return false; ex = BlkValueExtent(list); len = arr-->2; if ((len+LIST_ITEM_BASE > ex) && (BlkValueSetExtent(list, len+LIST_ITEM_BASE) == false)) return 0; BlkValueWrite(list, LIST_LENGTH_F, len); if (rea == 2) bk = BlkValueRead(list, LIST_ITEM_KOV_F); else { bk = arr-->1; BlkValueWrite(list, LIST_ITEM_KOV_F, bk); } BlkValueWrite(list, LIST_ITEM_COMPARE_F, KOVComparisonFunction(arr-->1)); for (i=0:i(i+3); if (bk == LIST_OF_TY) { w = LIST_OF_TY_Create(v-->1); LIST_OF_TY_CopyRawArray(w, v); BlkValueWrite(list, i+LIST_ITEM_BASE, w); } else { if (KOVIsBlockValue(bk)) v = BlkValueCreate(bk, v); BlkValueWrite(list, i+LIST_ITEM_BASE, v); } } #ifdef SHOW_ALLOCATIONS; print "Copied raw array to list: "; LIST_OF_TY_Say(list, 1); print "^"; #endif; return list; ]; [ LIST_OF_TY_Destroy list no_items i; if (KOVIsBlockValue(BlkValueRead(list, LIST_ITEM_KOV_F))) { no_items = BlkValueRead(list, LIST_LENGTH_F); for (i=0; i ex) { if (BlkValueSetExtent(list, len+LIST_ITEM_BASE) == false) return 0; } if (kov) BlkValueWrite(list, LIST_ITEM_KOV_F, kov); else BlkValueWrite(list, LIST_ITEM_KOV_F, OBJECT_TY); BlkValueWrite(list, LIST_LENGTH_F, len); obj = 0; for (i=0: i no_items+1))) { print "*** Couldn't add at entry ", posn, " in the list "; LIST_OF_TY_Say(list, true); print ", which has entries in the range 1 to ", no_items, " ***^"; RunTimeProblem(RTP_LISTRANGEERROR); rfalse; } ex = BlkValueExtent(list); if (no_items+LIST_ITEM_BASE+1 > ex) { if (BlkValueSetExtent(list, ex+16) == false) return 0; } if (KOVIsBlockValue(BlkValueRead(list, LIST_ITEM_KOV_F))) { nv = BlkValueCreate(BlkValueRead(list, LIST_ITEM_KOV_F)); BlkValueCopy(nv, v); v = nv; } if (posnflag) { posn--; for (i=no_items:i>posn:i--) { BlkValueWrite(list, i+LIST_ITEM_BASE, BlkValueRead(list, i-1+LIST_ITEM_BASE)); } BlkValueWrite(list, posn+LIST_ITEM_BASE, v); } else { BlkValueWrite(list, no_items+LIST_ITEM_BASE, v); } BlkValueWrite(list, LIST_LENGTH_F, no_items+1); return list; ]; [ LIST_OF_TY_AppendList list more posnflag posn nodups v i j no_items msize ex nv; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return false; if ((more==0) || (BlkType(more) ~= LIST_OF_TY)) return list; no_items = BlkValueRead(list, LIST_LENGTH_F); if ((posnflag) && ((posn<1) || (posn > no_items+1))) { print "*** Couldn't add at entry ", posn, " in the list "; LIST_OF_TY_Say(list, true); print ", which has entries in the range 1 to ", no_items, " ***^"; RunTimeProblem(RTP_LISTRANGEERROR); rfalse; } msize = BlkValueRead(more, LIST_LENGTH_F); ex = BlkValueExtent(list); if (no_items+msize+LIST_ITEM_BASE > ex) { if (BlkValueSetExtent(list, no_items+msize+LIST_ITEM_BASE+8) == false) return 0; } if (posnflag) { posn--; for (i=no_items+msize:i>=posn+msize:i--) { BlkValueWrite(list, i+LIST_ITEM_BASE, BlkValueRead(list, i-msize+LIST_ITEM_BASE)); } BlkValueWrite(list, posn, v); for (j=0: j to) || (from <= 0) || (to > no_items)) { if (forgive) { if (from <= 0) from = 1; if (to >= no_items) to = no_items; if (from > to) return list; } else { print "*** Couldn't remove entries ", from, " to ", to, " from the list "; LIST_OF_TY_Say(list, true); print ", which has entries in the range 1 to ", no_items, " ***^"; RunTimeProblem(RTP_LISTRANGEERROR); rfalse; } } to--; from--; d = to-from+1; if (KOVIsBlockValue(BlkValueRead(list, LIST_ITEM_KOV_F))) for (i=0; i ex) { if (BlkValueSetExtent(list, newsize+LIST_ITEM_BASE) == false) return 0; } dv = DefaultValueOfKOV(BlkValueRead(list, LIST_ITEM_KOV_F)); for (i=no_items: i newsize) { if (this_way_only == 1) return list; if (truncation_end == -1) { if (KOVIsBlockValue(BlkValueRead(list, LIST_ITEM_KOV_F))) for (i=0: ino_items)) { if (forgive) return false; print "*** Couldn't read from list entry ", i, ": the list "; LIST_OF_TY_Say(list, true); switch (no_items) { 0: print " is empty ***^"; 1: print " has only one entry, numbered 1 ***^"; default: print " has entries numbered from 1 to ", no_items, " ***^"; } RunTimeProblem(RTP_LISTRANGEERROR); if (no_items >= 1) i = 1; else return false; } return BlkValueRead(list, LIST_ITEM_BASE+i-1); ]; [ WriteLIST_OF_TY_GetItem list i val no_items; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return false; no_items = BlkValueRead(list, LIST_LENGTH_F); if ((i<=0) || (i>no_items)) { print "*** Couldn't write to list entry ", i, ": the list "; LIST_OF_TY_Say(list, true); switch (no_items) { 0: print " is empty ***^"; 1: print " has only one entry, numbered 1 ***^"; default: print " has entries numbered from 1 to ", no_items, " ***^"; } return RunTimeProblem(RTP_LISTRANGEERROR); } BlkValueWrite(list, LIST_ITEM_BASE+i-1, val); ]; [ LIST_OF_TY_PutItem list i v no_items nv; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return false; no_items = BlkValueRead(list, LIST_LENGTH_F); if (KOVIsBlockValue(BlkValueRead(list, LIST_ITEM_KOV_F))) { nv = BlkValueCreate(BlkValueRead(list, LIST_ITEM_KOV_F)); BlkValueCopy(nv, v); v = nv; } if ((i<=0) || (i>no_items)) return false; BlkValueWrite(list, LIST_ITEM_BASE+i-1, v); ]; [ LIST_OF_TY_Mol list len i; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return 0; len = multiple_object-->0; LIST_OF_TY_SetLength(list, len); for (i=1: i<=len: i++) LIST_OF_TY_PutItem(list, i, multiple_object-->i); return list; ]; [ LIST_OF_TY_Set_Mol list len i; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return 0; len = BlkValueRead(list, LIST_LENGTH_F); if (len > 63) len = 63; multiple_object-->0 = len; for (i=1: i<=len: i++) multiple_object-->i = BlkValueRead(list, LIST_ITEM_BASE+i-1); ]; [ LIST_OF_TY_Reverse list no_items i v; if ((list==0) || (BlkType(list) ~= LIST_OF_TY)) return 0; no_items = BlkValueRead(list, LIST_LENGTH_F); if (no_items < 2) return list; for (i=0;i*20:i--) BlkValueWrite(list, LIST_ITEM_BASE+i, BlkValueRead(list, LIST_ITEM_BASE+i-1)); BlkValueWrite(list, LIST_ITEM_BASE, v); } return list; ]; [ LIST_OF_TY_Sort list dir prop i j no_items v; no_items = BlkValueRead(list, LIST_LENGTH_F); if (dir == 2) { if (no_items < 2) return; for (i=1:i 1 0 0; [ PrintFigureName f; switch(f) { 1: print "Figure of cover"; default: print ""; } ]; Array TableOfSounds --> 0 0; [ PrintSoundName f; switch(f) { 0: print ""; default: print ""; } ]; [ CreateBlockConstants; ]; ! End of automatically generated I6 source ! --------------------------------------------------------------------------